aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/japanese-util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/language/japanese-util.js')
-rw-r--r--ext/js/language/japanese-util.js29
1 files changed, 10 insertions, 19 deletions
diff --git a/ext/js/language/japanese-util.js b/ext/js/language/japanese-util.js
index 7ee726b2..9d7ad0d8 100644
--- a/ext/js/language/japanese-util.js
+++ b/ext/js/language/japanese-util.js
@@ -277,6 +277,10 @@ const JapaneseUtil = (() => {
return this._getWanakana().toKana(text);
}
+ convertToKanaSupported() {
+ return this._wanakana !== null;
+ }
+
convertKatakanaToHiragana(text) {
let result = '';
const offset = (HIRAGANA_CONVERSION_RANGE[0] - KATAKANA_CONVERSION_RANGE[0]);
@@ -315,25 +319,8 @@ const JapaneseUtil = (() => {
return wanakana.toRomaji(text);
}
- convertReading(term, reading, readingMode) {
- switch (readingMode) {
- case 'hiragana':
- return this.convertKatakanaToHiragana(reading);
- case 'katakana':
- return this.convertHiraganaToKatakana(reading);
- case 'romaji':
- if (reading.length > 0) {
- return this.convertToRomaji(reading);
- } else if (this.isStringEntirelyKana(term)) {
- return this.convertToRomaji(term);
- } else {
- return reading;
- }
- case 'none':
- return '';
- default:
- return reading;
- }
+ convertToRomajiSupported() {
+ return this._wanakana !== null;
}
convertNumericToFullWidth(text) {
@@ -426,6 +413,10 @@ const JapaneseUtil = (() => {
return result;
}
+ convertAlphabeticToKanaSupported() {
+ return this._wanakana !== null;
+ }
+
// Furigana distribution
distributeFurigana(term, reading) {