summaryrefslogtreecommitdiff
path: root/ext/js/language/japanese-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-07-09 16:05:57 -0400
committerGitHub <noreply@github.com>2021-07-09 16:05:57 -0400
commit24ec22b2e1095a18d2031f697f4aaffb5a0c0609 (patch)
treee5ec013cd2123fe0a01e0b6148c77f18e84469c6 /ext/js/language/japanese-util.js
parent315dc425e489dc96c2f2d4e13b500105d724ec52 (diff)
Text parse updates (#1811)
* Expose more settings to QueryParser * Rename textParse to parseText * Refactor * Convert reading inside QueryParser rather than Backend * Remove use of readingMode from backend * Rename * Update parseText args * Simplify * Update results * Move use of optionsContext * Run mecab and internal parser in parallel * Added "dictionary-reading" reading mode * Update romaji conversion case
Diffstat (limited to 'ext/js/language/japanese-util.js')
-rw-r--r--ext/js/language/japanese-util.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/js/language/japanese-util.js b/ext/js/language/japanese-util.js
index 8780c24c..7ee726b2 100644
--- a/ext/js/language/japanese-util.js
+++ b/ext/js/language/japanese-util.js
@@ -322,14 +322,13 @@ const JapaneseUtil = (() => {
case 'katakana':
return this.convertHiraganaToKatakana(reading);
case 'romaji':
- if (reading) {
+ if (reading.length > 0) {
return this.convertToRomaji(reading);
+ } else if (this.isStringEntirelyKana(term)) {
+ return this.convertToRomaji(term);
} else {
- if (this.isStringEntirelyKana(term)) {
- return this.convertToRomaji(term);
- }
+ return reading;
}
- return reading;
case 'none':
return '';
default: