aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/deinflector.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-20 13:04:59 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-20 13:04:59 -0700
commit9649a831814816adfed54f45cfceb338993bb2fb (patch)
treef8e6e483c80a1fbbd6351d2d80aa4fea2ec100b5 /ext/bg/js/deinflector.js
parent28e217b75be75fc52dde9aabdf9b52d413497533 (diff)
Better control over result ordering. This fixes #12
Diffstat (limited to 'ext/bg/js/deinflector.js')
-rw-r--r--ext/bg/js/deinflector.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js
index bbb228b5..24289b0c 100644
--- a/ext/bg/js/deinflector.js
+++ b/ext/bg/js/deinflector.js
@@ -26,12 +26,12 @@ class Deinflection {
}
validate(validator) {
- for (let tags of validator(this.term)) {
+ for (const tags of validator(this.term)) {
if (this.tags.length === 0) {
return true;
}
- for (let tag of this.tags) {
+ for (const tag of this.tags) {
if (tags.indexOf(tag) !== -1) {
return true;
}
@@ -47,11 +47,11 @@ class Deinflection {
this.children.push(child);
}
- for (let rule in rules) {
+ for (const rule in rules) {
const variants = rules[rule];
- for (let v of variants) {
+ for (const v of variants) {
let allowed = this.tags.length === 0;
- for (let tag of this.tags) {
+ for (const tag of this.tags) {
if (v.ti.indexOf(tag) !== -1) {
allowed = true;
break;
@@ -79,8 +79,8 @@ class Deinflection {
}
const paths = [];
- for (let child of this.children) {
- for (let path of child.gather()) {
+ for (const child of this.children) {
+ for (const path of child.gather()) {
if (this.rule.length > 0) {
path.rules.push(this.rule);
}