Remove redundant alphanumeric parameter from findTermsInternal
This commit is contained in:
parent
73cc64fb5c
commit
fb6e56b3b7
@ -151,7 +151,7 @@ class Translator {
|
|||||||
async findTermsGrouped(text, details, options) {
|
async findTermsGrouped(text, details, options) {
|
||||||
const dictionaries = dictEnabledSet(options);
|
const dictionaries = dictEnabledSet(options);
|
||||||
const titles = Object.keys(dictionaries);
|
const titles = Object.keys(dictionaries);
|
||||||
const [definitions, length] = await this.findTermsInternal(text, dictionaries, options.scanning.alphanumeric, details, options);
|
const [definitions, length] = await this.findTermsInternal(text, dictionaries, details, options);
|
||||||
|
|
||||||
const definitionsGrouped = dictTermsGroup(definitions, dictionaries);
|
const definitionsGrouped = dictTermsGroup(definitions, dictionaries);
|
||||||
await this.buildTermFrequencies(definitionsGrouped, titles);
|
await this.buildTermFrequencies(definitionsGrouped, titles);
|
||||||
@ -169,7 +169,7 @@ class Translator {
|
|||||||
const dictionaries = dictEnabledSet(options);
|
const dictionaries = dictEnabledSet(options);
|
||||||
const secondarySearchTitles = Object.keys(options.dictionaries).filter((dict) => options.dictionaries[dict].allowSecondarySearches);
|
const secondarySearchTitles = Object.keys(options.dictionaries).filter((dict) => options.dictionaries[dict].allowSecondarySearches);
|
||||||
const titles = Object.keys(dictionaries);
|
const titles = Object.keys(dictionaries);
|
||||||
const [definitions, length] = await this.findTermsInternal(text, dictionaries, options.scanning.alphanumeric, details, options);
|
const [definitions, length] = await this.findTermsInternal(text, dictionaries, details, options);
|
||||||
const {sequencedDefinitions, defaultDefinitions} = await this.getSequencedDefinitions(definitions, options.general.mainDictionary);
|
const {sequencedDefinitions, defaultDefinitions} = await this.getSequencedDefinitions(definitions, options.general.mainDictionary);
|
||||||
const definitionsMerged = [];
|
const definitionsMerged = [];
|
||||||
const mergedByTermIndices = new Set();
|
const mergedByTermIndices = new Set();
|
||||||
@ -206,15 +206,15 @@ class Translator {
|
|||||||
async findTermsSplit(text, details, options) {
|
async findTermsSplit(text, details, options) {
|
||||||
const dictionaries = dictEnabledSet(options);
|
const dictionaries = dictEnabledSet(options);
|
||||||
const titles = Object.keys(dictionaries);
|
const titles = Object.keys(dictionaries);
|
||||||
const [definitions, length] = await this.findTermsInternal(text, dictionaries, options.scanning.alphanumeric, details, options);
|
const [definitions, length] = await this.findTermsInternal(text, dictionaries, details, options);
|
||||||
|
|
||||||
await this.buildTermFrequencies(definitions, titles);
|
await this.buildTermFrequencies(definitions, titles);
|
||||||
|
|
||||||
return [definitions, length];
|
return [definitions, length];
|
||||||
}
|
}
|
||||||
|
|
||||||
async findTermsInternal(text, dictionaries, alphanumeric, details, options) {
|
async findTermsInternal(text, dictionaries, details, options) {
|
||||||
if (!alphanumeric && text.length > 0) {
|
if (!options.scanning.alphanumeric && text.length > 0) {
|
||||||
const c = text[0];
|
const c = text[0];
|
||||||
if (!jpIsKana(c) && !jpIsKanji(c)) {
|
if (!jpIsKana(c) && !jpIsKanji(c)) {
|
||||||
return [[], 0];
|
return [[], 0];
|
||||||
|
Loading…
Reference in New Issue
Block a user