This commit is contained in:
Alex Yatskov 2016-09-10 19:44:54 -07:00
parent 47ef617eb4
commit 0587399883
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ class Deinflector {
deinflect(term, validator) {
const node = new Deinflection(term);
return node.deinflect(validator, this.rules).then(success => {
return success ? node.gather() : null;
return success ? node.gather() : [];
});
}
}

View File

@ -63,7 +63,7 @@ class Translator {
this.deinflector.deinflect(text.slice(0, i), term => {
return this.dictionary.findTerm(term).then(definitions => definitions.map(def => def.tags));
}).then(inflects => {
for (const inflect of inflects || []) {
for (const inflect of inflects) {
this.processTerm(groups, df.source, df.tags, df.rules, df.root);
}
})