summaryrefslogtreecommitdiff
path: root/ext/js/language/japanese-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-04-13 20:32:24 -0400
committerGitHub <noreply@github.com>2021-04-13 20:32:24 -0400
commit609d4fe3347f87290a428e2ba1192acb991b2e38 (patch)
tree57a37b970bc5564ab7a958aa695b5351aecdb793 /ext/js/language/japanese-util.js
parentbbf47865ffa616128543396c97aa861d8a423a36 (diff)
Replace furigana with reading (#1614)
* Use "reading" instead of "furigana" for reading distribution * Update tests
Diffstat (limited to 'ext/js/language/japanese-util.js')
-rw-r--r--ext/js/language/japanese-util.js10
1 files changed, 5 insertions, 5 deletions
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