diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-05-25 23:06:10 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-05-25 23:06:10 -0700 |
commit | 16baf9a400ac11a1c4f53ba6665db03a900511e0 (patch) | |
tree | 685096179093f112a9263f15d3cf081f50e9634d /ext/bg/js/translator.js | |
parent | 1cdf496824709b4e4579d700c333e832d790925e (diff) | |
parent | 618a3cb319c247c7196b1b83389d5f43241ab0c6 (diff) |
Merge branch 'master' into firefox-amo
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r-- | ext/bg/js/translator.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index b3b90641..8d65a0cd 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -41,7 +41,7 @@ class Translator { }); } - findTerms(text, dictionaries, softKatakana, alphanumeric) { + findTerms(text, dictionaries, alphanumeric) { const titles = Object.keys(dictionaries); const cache = {}; @@ -54,10 +54,10 @@ class Translator { return this.findTermsDeinflected(text, titles, cache).then(deinfLiteral => { const textHiragana = wanakana._katakanaToHiragana(text); - if (text !== textHiragana && softKatakana) { - return this.findTermsDeinflected(textHiragana, titles, cache).then(deinfHiragana => deinfLiteral.concat(deinfHiragana)); - } else { + if (text === textHiragana) { return deinfLiteral; + } else { + return this.findTermsDeinflected(textHiragana, titles, cache).then(deinfHiragana => deinfLiteral.concat(deinfHiragana)); } }).then(deinflections => { let definitions = []; @@ -91,8 +91,8 @@ class Translator { }); } - findTermsGrouped(text, dictionaries, softKatakana, alphanumeric) { - return this.findTerms(text, dictionaries, softKatakana, alphanumeric).then(({length, definitions}) => { + findTermsGrouped(text, dictionaries, alphanumeric) { + return this.findTerms(text, dictionaries, alphanumeric).then(({length, definitions}) => { return {length, definitions: dictTermsGroup(definitions, dictionaries)}; }); } |