We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22ac3de commit a12f1b2Copy full SHA for a12f1b2
source/library/ensure-tense.js
@@ -10,9 +10,25 @@ const tenses = {
10
'present-third-person': ['VB', 'VBZ']
11
};
12
13
+function getLemmata(input) {
14
+ try {
15
+ return lexer.lex(input);
16
+ } catch (err) {
17
+ return [];
18
+ }
19
+}
20
+
21
+function getTags(lemmata) {
22
23
+ return tagger.tag(lemmata);
24
25
26
27
28
29
export default (input, allowed) => {
- const lemmata = lexer.lex(input);
- const tagged = tagger.tag(lemmata);
30
+ const lemmata = getLemmata(input);
31
+ const tagged = getTags(lemmata);
32
const verbs = tagged.filter(tag => tag[1][0] === 'V');
33
const tags = allowed.reduce((registry, name) => {
34
return [
0 commit comments