diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-04-13 22:55:33 +0300 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2020-04-13 22:55:33 +0300 |
commit | f93dc857107e9b23ec06f1b568aad2c6f870ba4c (patch) | |
tree | 8d691c01e3e6a449c6530402398d60cc0b76cc7e /ext/bg/js/japanese.js | |
parent | 25bc86c3ce44bd7823d0d924e86969310c14dc8c (diff) |
assume and propagate strings for text parsing
Diffstat (limited to 'ext/bg/js/japanese.js')
-rw-r--r-- | ext/bg/js/japanese.js | 10 |
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; |