diff options
Diffstat (limited to 'ext/bg/js/japanese.js')
-rw-r--r-- | ext/bg/js/japanese.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/japanese.js b/ext/bg/js/japanese.js index e8a6fa08..abb32da4 100644 --- a/ext/bg/js/japanese.js +++ b/ext/bg/js/japanese.js @@ -224,15 +224,15 @@ function jpDistributeFurigana(expression, reading) { } let isAmbiguous = false; - const segmentize = (reading, groups) => { + const segmentize = (reading2, groups) => { if (groups.length === 0 || isAmbiguous) { return []; } const group = groups[0]; if (group.mode === 'kana') { - if (jpKatakanaToHiragana(reading).startsWith(jpKatakanaToHiragana(group.text))) { - const readingLeft = reading.substring(group.text.length); + if (jpKatakanaToHiragana(reading2).startsWith(jpKatakanaToHiragana(group.text))) { + const readingLeft = reading2.substring(group.text.length); const segs = segmentize(readingLeft, groups.splice(1)); if (segs) { return [{text: group.text}].concat(segs); @@ -240,9 +240,9 @@ function jpDistributeFurigana(expression, reading) { } } else { let foundSegments = null; - for (let i = reading.length; i >= group.text.length; --i) { - const readingUsed = reading.substring(0, i); - const readingLeft = reading.substring(i); + for (let i = reading2.length; i >= group.text.length; --i) { + const readingUsed = reading2.substring(0, i); + const readingLeft = reading2.substring(i); const segs = segmentize(readingLeft, groups.slice(1)); if (segs) { if (foundSegments !== null) { |