Improved deinflection

This commit is contained in:
Alex Yatskov 2016-03-24 20:13:43 -07:00
parent 14f855ee75
commit 125df215dd
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ class Deinflection {
return true; return true;
} }
for (const tag in this.tags) { for (const tag of this.tags) {
if (this.searchTags(tag, tags)) { if (this.searchTags(tag, tags)) {
return true; return true;
} }
@ -51,7 +51,7 @@ class Deinflection {
const variants = rules[rule]; const variants = rules[rule];
for (const v of variants) { for (const v of variants) {
let allowed = this.tags.length === 0; let allowed = this.tags.length === 0;
for (const tag in this.tags) { for (const tag of this.tags) {
if (this.searchTags(tag, v.tagsIn)) { if (this.searchTags(tag, v.tagsIn)) {
allowed = true; allowed = true;
break; break;

View File

@ -61,7 +61,7 @@ class Dictionary {
expression: e, expression: e,
reading: r, reading: r,
glossary: g, glossary: g,
tags: t tags: t.split(' ')
}; };
}); });
} }