diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-04-13 20:32:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-13 20:32:24 -0400 |
commit | 609d4fe3347f87290a428e2ba1192acb991b2e38 (patch) | |
tree | 57a37b970bc5564ab7a958aa695b5351aecdb793 /ext/js/background | |
parent | bbf47865ffa616128543396c97aa861d8a423a36 (diff) |
Replace furigana with reading (#1614)
* Use "reading" instead of "furigana" for reading distribution
* Update tests
Diffstat (limited to 'ext/js/background')
-rw-r--r-- | ext/js/background/backend.js | 12 |
1 files changed, 6 insertions, 6 deletions
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); } |