From 609d4fe3347f87290a428e2ba1192acb991b2e38 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 13 Apr 2021 20:32:24 -0400 Subject: Replace furigana with reading (#1614) * Use "reading" instead of "furigana" for reading distribution * Update tests --- ext/js/language/japanese-util.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/js/language') diff --git a/ext/js/language/japanese-util.js b/ext/js/language/japanese-util.js index 4d5e8092..8780c24c 100644 --- a/ext/js/language/japanese-util.js +++ b/ext/js/language/japanese-util.js @@ -507,7 +507,7 @@ const JapaneseUtil = (() => { if (stemLength < source.length) { const remainder = source.substring(stemLength); const segmentCount = segments.length; - if (segmentCount > 0 && segments[segmentCount - 1].furigana.length === 0) { + if (segmentCount > 0 && segments[segmentCount - 1].reading.length === 0) { // Append to the last segment if it has an empty reading segments[segmentCount - 1].text += remainder; } else { @@ -554,8 +554,8 @@ const JapaneseUtil = (() => { // Private - _createFuriganaSegment(text, furigana) { - return {text, furigana}; + _createFuriganaSegment(text, reading) { + return {text, reading}; } _segmentizeFurigana(reading, readingNormalized, groups, groupsStart) { @@ -600,8 +600,8 @@ const JapaneseUtil = (() => { // More than one way to segmentize the tail; mark as ambiguous return null; } - const furigana = reading.substring(0, i); - segments.unshift(this._createFuriganaSegment(text, furigana)); + const segmentReading = reading.substring(0, i); + segments.unshift(this._createFuriganaSegment(text, segmentReading)); result = segments; } // There is only one way to segmentize the last non-kana group -- cgit v1.2.3