aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/deinflector.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-09-11 12:29:18 -0700
committerAlex Yatskov <alex@foosoft.net>2016-09-11 12:29:18 -0700
commitd5ea03171ea997d6734e6d31197c7f233fff7084 (patch)
treef10dbfbc9868f5b9aaae2cefb0bbbcf3a56e4514 /ext/bg/js/deinflector.js
parent1ac14cd633b3a99a3dd8ec8d0ec29158077b3798 (diff)
Working with IndexDb
Diffstat (limited to 'ext/bg/js/deinflector.js')
-rw-r--r--ext/bg/js/deinflector.js12
1 files changed, 5 insertions, 7 deletions
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() : []);
}
}