Simplify collapseEmphaticOptions options (#1196)
This commit is contained in:
parent
a02891e52c
commit
41f6de3e3a
@ -301,22 +301,13 @@ class Translator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getAllDeinflections(text, options) {
|
_getAllDeinflections(text, options) {
|
||||||
const collapseEmphaticOptions = [[false, false]];
|
|
||||||
switch (options.collapseEmphaticSequences) {
|
|
||||||
case 'true':
|
|
||||||
collapseEmphaticOptions.push([true, false]);
|
|
||||||
break;
|
|
||||||
case 'full':
|
|
||||||
collapseEmphaticOptions.push([true, false], [true, true]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
const textOptionVariantArray = [
|
const textOptionVariantArray = [
|
||||||
this._getTextOptionEntryVariants(options.convertHalfWidthCharacters),
|
this._getTextOptionEntryVariants(options.convertHalfWidthCharacters),
|
||||||
this._getTextOptionEntryVariants(options.convertNumericCharacters),
|
this._getTextOptionEntryVariants(options.convertNumericCharacters),
|
||||||
this._getTextOptionEntryVariants(options.convertAlphabeticCharacters),
|
this._getTextOptionEntryVariants(options.convertAlphabeticCharacters),
|
||||||
this._getTextOptionEntryVariants(options.convertHiraganaToKatakana),
|
this._getTextOptionEntryVariants(options.convertHiraganaToKatakana),
|
||||||
this._getTextOptionEntryVariants(options.convertKatakanaToHiragana),
|
this._getTextOptionEntryVariants(options.convertKatakanaToHiragana),
|
||||||
collapseEmphaticOptions
|
this._getCollapseEmphaticOptions(options)
|
||||||
];
|
];
|
||||||
|
|
||||||
const jp = this._japaneseUtil;
|
const jp = this._japaneseUtil;
|
||||||
@ -875,6 +866,19 @@ class Translator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getCollapseEmphaticOptions(options) {
|
||||||
|
const collapseEmphaticOptions = [[false, false]];
|
||||||
|
switch (options.collapseEmphaticSequences) {
|
||||||
|
case 'true':
|
||||||
|
collapseEmphaticOptions.push([true, false]);
|
||||||
|
break;
|
||||||
|
case 'full':
|
||||||
|
collapseEmphaticOptions.push([true, false], [true, true]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return collapseEmphaticOptions;
|
||||||
|
}
|
||||||
|
|
||||||
_getSecondarySearchDictionaryMap(enabledDictionaryMap) {
|
_getSecondarySearchDictionaryMap(enabledDictionaryMap) {
|
||||||
const secondarySearchDictionaryMap = new Map();
|
const secondarySearchDictionaryMap = new Map();
|
||||||
for (const [dictionary, details] of enabledDictionaryMap.entries()) {
|
for (const [dictionary, details] of enabledDictionaryMap.entries()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user