summaryrefslogtreecommitdiff
path: root/ext/bg/js/japanese.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-13 22:55:33 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-13 22:55:33 +0300
commitf93dc857107e9b23ec06f1b568aad2c6f870ba4c (patch)
tree8d691c01e3e6a449c6530402398d60cc0b76cc7e /ext/bg/js/japanese.js
parent25bc86c3ce44bd7823d0d924e86969310c14dc8c (diff)
assume and propagate strings for text parsing
Diffstat (limited to 'ext/bg/js/japanese.js')
-rw-r--r--ext/bg/js/japanese.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/bg/js/japanese.js b/ext/bg/js/japanese.js
index 5fef27a7..c74e4553 100644
--- a/ext/bg/js/japanese.js
+++ b/ext/bg/js/japanese.js
@@ -127,9 +127,9 @@
function convertReading(expressionFragment, readingFragment, readingMode) {
switch (readingMode) {
case 'hiragana':
- return convertKatakanaToHiragana(readingFragment || '');
+ return convertKatakanaToHiragana(readingFragment);
case 'katakana':
- return convertHiraganaToKatakana(readingFragment || '');
+ return convertHiraganaToKatakana(readingFragment);
case 'romaji':
if (readingFragment) {
return convertToRomaji(readingFragment);
@@ -140,7 +140,7 @@
}
return readingFragment;
case 'none':
- return null;
+ return '';
default:
return readingFragment;
}
@@ -300,7 +300,7 @@
const readingLeft = reading2.substring(group.text.length);
const segs = segmentize(readingLeft, groups.splice(1));
if (segs) {
- return [{text: group.text}].concat(segs);
+ return [{text: group.text, furigana: ''}].concat(segs);
}
}
} else {
@@ -368,7 +368,7 @@
}
if (stemLength !== source.length) {
- output.push({text: source.substring(stemLength)});
+ output.push({text: source.substring(stemLength), furigana: ''});
}
return output;