This commit is contained in:
Alex Yatskov 2017-07-09 16:29:52 -07:00
parent b3984ccd54
commit 6e986bf1f5
3 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class Database {
} }
prepare() { prepare() {
if (!this.db) { if (this.db) {
return Promise.reject('database already initialized'); return Promise.reject('database already initialized');
} }

View File

@ -53,7 +53,7 @@ class Translator {
} }
return this.findTermsDeinflected(text, titles, cache).then(deinfLiteral => { return this.findTermsDeinflected(text, titles, cache).then(deinfLiteral => {
const textHiragana = wanakana._katakanaToHiragana(text); const textHiragana = jpKatakanaToHiragana(text);
if (text === textHiragana) { if (text === textHiragana) {
return deinfLiteral; return deinfLiteral;
} else { } else {

View File

@ -43,6 +43,10 @@ function jpIsKana(c) {
return wanakana.isKana(c); return wanakana.isKana(c);
} }
function jpKatakanaToHiragana(text) {
return wanakana._katakanaToHiragana(text);
}
/* /*
* Commands * Commands