summaryrefslogtreecommitdiff
path: root/ext/js/language/japanese-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-04-04 16:22:35 -0400
committerGitHub <noreply@github.com>2021-04-04 16:22:35 -0400
commite14b52ef84be7feeab60167605fd10918a242cd3 (patch)
treeb9b124d9ed77806a7ad8b52c6e779da0f4844993 /ext/js/language/japanese-util.js
parentb8bedd5185869edb33a7657fff323f812444eed0 (diff)
Update dictionary entry terminology (#1592)
* Update terminology * Update terminology in display.js * Update terminology in display-audio.js * Update terminology in text-scanner.js * Update terminology in backend.js * Update terminology in mecab.js * Update terminology in audio-downloader.js * Update terminology in translator-vm.js * Update terminology in dictionary-data-util.js * Update terminology in dictionary-database.js * Update terminology in japanese-util.js * Change/upgrade {expression} to {term} * Update terminology in test-japanese.js * Update terminology in test-database.js * Update terminology in anki-templates-controller.js * Update terminology in anki-note-builder.js * Update terminology in backend.js * Update terminology in text-scanner.js * Update terminology in display.js * Update terminology in display.js
Diffstat (limited to 'ext/js/language/japanese-util.js')
-rw-r--r--ext/js/language/japanese-util.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/js/language/japanese-util.js b/ext/js/language/japanese-util.js
index cade393b..4d5e8092 100644
--- a/ext/js/language/japanese-util.js
+++ b/ext/js/language/japanese-util.js
@@ -315,7 +315,7 @@ const JapaneseUtil = (() => {
return wanakana.toRomaji(text);
}
- convertReading(expression, reading, readingMode) {
+ convertReading(term, reading, readingMode) {
switch (readingMode) {
case 'hiragana':
return this.convertKatakanaToHiragana(reading);
@@ -325,8 +325,8 @@ const JapaneseUtil = (() => {
if (reading) {
return this.convertToRomaji(reading);
} else {
- if (this.isStringEntirelyKana(expression)) {
- return this.convertToRomaji(expression);
+ if (this.isStringEntirelyKana(term)) {
+ return this.convertToRomaji(term);
}
}
return reading;
@@ -429,16 +429,16 @@ const JapaneseUtil = (() => {
// Furigana distribution
- distributeFurigana(expression, reading) {
- if (reading === expression) {
+ distributeFurigana(term, reading) {
+ if (reading === term) {
// Same
- return [this._createFuriganaSegment(expression, '')];
+ return [this._createFuriganaSegment(term, '')];
}
const groups = [];
let groupPre = null;
let isKanaPre = null;
- for (const c of expression) {
+ for (const c of term) {
const codePoint = c.codePointAt(0);
const isKana = !(this.isCodePointKanji(codePoint) || codePoint === ITERATION_MARK_CODE_POINT);
if (isKana === isKanaPre) {
@@ -462,18 +462,18 @@ const JapaneseUtil = (() => {
}
// Fallback
- return [this._createFuriganaSegment(expression, reading)];
+ return [this._createFuriganaSegment(term, reading)];
}
- distributeFuriganaInflected(expression, reading, source) {
- const expressionNormalized = this.convertKatakanaToHiragana(expression);
+ distributeFuriganaInflected(term, reading, source) {
+ const termNormalized = this.convertKatakanaToHiragana(term);
const readingNormalized = this.convertKatakanaToHiragana(reading);
const sourceNormalized = this.convertKatakanaToHiragana(source);
- let mainText = expression;
- let stemLength = this._getStemLength(expressionNormalized, sourceNormalized);
+ let mainText = term;
+ let stemLength = this._getStemLength(termNormalized, sourceNormalized);
- // Check if source is derived from the reading instead of the expression
+ // Check if source is derived from the reading instead of the term
const readingStemLength = this._getStemLength(readingNormalized, sourceNormalized);
if (readingStemLength > 0 && readingStemLength >= stemLength) {
mainText = reading;