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/background/backend.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/js/background') diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index 21b18e99..84ff2c0d 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -1066,9 +1066,9 @@ class Backend { const {headwords: [{term, reading}]} = dictionaryEntries[0]; const source = text.substring(i, i + originalTextLength); const textSegments = []; - for (const {text: text2, furigana} of jp.distributeFuriganaInflected(term, reading, source)) { - const reading2 = jp.convertReading(text2, furigana, readingMode); - textSegments.push({text: text2, reading: reading2}); + for (const {text: text2, reading: reading2} of jp.distributeFuriganaInflected(term, reading, source)) { + const reading3 = jp.convertReading(text2, reading2, readingMode); + textSegments.push({text: text2, reading: reading3}); } results.push(textSegments); i += originalTextLength; @@ -1102,13 +1102,13 @@ class Backend { for (const line of lines) { for (const {term, reading, source} of line) { const termParts = []; - for (const {text: text2, furigana} of jp.distributeFuriganaInflected( + for (const {text: text2, reading: reading2} of jp.distributeFuriganaInflected( term.length > 0 ? term : source, jp.convertKatakanaToHiragana(reading), source )) { - const reading2 = jp.convertReading(text2, furigana, readingMode); - termParts.push({text: text2, reading: reading2}); + const reading3 = jp.convertReading(text2, reading2, readingMode); + termParts.push({text: text2, reading: reading3}); } result.push(termParts); } -- cgit v1.2.3