From 058739988302513c8496e569cf3a4fd1eb5920b4 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 10 Sep 2016 19:44:54 -0700 Subject: [PATCH] WIP --- ext/bg/js/deinflector.js | 2 +- ext/bg/js/translator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js index 2d567e6b..4cdc9a3d 100644 --- a/ext/bg/js/deinflector.js +++ b/ext/bg/js/deinflector.js @@ -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() : []; }); } } diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index dcc2e5ac..ccf1876f 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -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); } })