From 125df215dd06355f26e117e8fd20e2d6a9ee1c22 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 24 Mar 2016 20:13:43 -0700 Subject: [PATCH] Improved deinflection --- ext/jp/deinflector.js | 4 ++-- ext/jp/dictionary.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/jp/deinflector.js b/ext/jp/deinflector.js index 3dd233eb..8c23de81 100644 --- a/ext/jp/deinflector.js +++ b/ext/jp/deinflector.js @@ -31,7 +31,7 @@ class Deinflection { return true; } - for (const tag in this.tags) { + for (const tag of this.tags) { if (this.searchTags(tag, tags)) { return true; } @@ -51,7 +51,7 @@ class Deinflection { const variants = rules[rule]; for (const v of variants) { let allowed = this.tags.length === 0; - for (const tag in this.tags) { + for (const tag of this.tags) { if (this.searchTags(tag, v.tagsIn)) { allowed = true; break; diff --git a/ext/jp/dictionary.js b/ext/jp/dictionary.js index e9e81503..eff54890 100644 --- a/ext/jp/dictionary.js +++ b/ext/jp/dictionary.js @@ -61,7 +61,7 @@ class Dictionary { expression: e, reading: r, glossary: g, - tags: t + tags: t.split(' ') }; }); }