remove "fragment" from jp.convertReading variables
This commit is contained in:
parent
f93dc85710
commit
6cc87ec975
@ -124,25 +124,25 @@
|
|||||||
return wanakana.toRomaji(text);
|
return wanakana.toRomaji(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertReading(expressionFragment, readingFragment, readingMode) {
|
function convertReading(expression, reading, readingMode) {
|
||||||
switch (readingMode) {
|
switch (readingMode) {
|
||||||
case 'hiragana':
|
case 'hiragana':
|
||||||
return convertKatakanaToHiragana(readingFragment);
|
return convertKatakanaToHiragana(reading);
|
||||||
case 'katakana':
|
case 'katakana':
|
||||||
return convertHiraganaToKatakana(readingFragment);
|
return convertHiraganaToKatakana(reading);
|
||||||
case 'romaji':
|
case 'romaji':
|
||||||
if (readingFragment) {
|
if (reading) {
|
||||||
return convertToRomaji(readingFragment);
|
return convertToRomaji(reading);
|
||||||
} else {
|
} else {
|
||||||
if (isStringEntirelyKana(expressionFragment)) {
|
if (isStringEntirelyKana(expression)) {
|
||||||
return convertToRomaji(expressionFragment);
|
return convertToRomaji(expression);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return readingFragment;
|
return reading;
|
||||||
case 'none':
|
case 'none':
|
||||||
return '';
|
return '';
|
||||||
default:
|
default:
|
||||||
return readingFragment;
|
return reading;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,8 +208,8 @@ function testConvertReading() {
|
|||||||
[['有り難う', '', 'default'], '']
|
[['有り難う', '', 'default'], '']
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const [[expressionFragment, readingFragment, readingMode], expected] of data) {
|
for (const [[expression, reading, readingMode], expected] of data) {
|
||||||
assert.strictEqual(jp.convertReading(expressionFragment, readingFragment, readingMode), expected);
|
assert.strictEqual(jp.convertReading(expression, reading, readingMode), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user