From d5ea03171ea997d6734e6d31197c7f233fff7084 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 11 Sep 2016 12:29:18 -0700 Subject: Working with IndexDb --- ext/bg/js/deinflector.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'ext/bg/js/deinflector.js') diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js index 4cdc9a3d..e5b1efe5 100644 --- a/ext/bg/js/deinflector.js +++ b/ext/bg/js/deinflector.js @@ -26,14 +26,14 @@ class Deinflection { } validate(validator) { - return validator(this.term).then(tagSets => { - for (const tags of tagSets) { + return validator(this.term).then(sets => { + for (const tags of sets) { if (this.tags.length === 0) { return true; } for (const tag of this.tags) { - if (tags.indexOf(tag) !== -1) { + if (tags.includes(tag)) { return true; } } @@ -55,7 +55,7 @@ class Deinflection { for (const variant of rules[rule]) { let allowed = this.tags.length === 0; for (const tag of this.tags) { - if (variant.ti.indexOf(tag) !== -1) { + if (variant.ti.includes(tag)) { allowed = true; break; } @@ -115,8 +115,6 @@ class Deinflector { deinflect(term, validator) { const node = new Deinflection(term); - return node.deinflect(validator, this.rules).then(success => { - return success ? node.gather() : []; - }); + return node.deinflect(validator, this.rules).then(success => success ? node.gather() : []); } } -- cgit v1.2.3