summaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-05-24 20:29:50 -0700
committerAlex Yatskov <alex@foosoft.net>2017-05-24 20:29:50 -0700
commit867f7dd24f21c3cb11642290a78507bd7012de52 (patch)
tree850d9d11761f37892c529db6742fee742baa717a /ext/bg/js/translator.js
parent0efab9773d0cc6586eb4a1f271821795b6d07f5c (diff)
make soft katakana search be implicit
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js12
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)};
});
}