summaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-12-17 17:02:13 -0500
committerGitHub <noreply@github.com>2021-12-17 17:02:13 -0500
commit8a377cabe6b3d177aac50cdb7ffb5a4328d27fd0 (patch)
tree59a84764df29679c01be2b0f2b191538947f6da8 /ext/js/background/backend.js
parent8e548a17eba180b5773a9900de3f3cb3a92ec6ff (diff)
matchType/deinflect distinction (#2040)
* Pass a "deinflect" option to findTerms * Update Translator to use deinflect option * Fix test input options
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index ce830361..994a6184 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -1080,7 +1080,7 @@ class Backend {
const jp = this._japaneseUtil;
const mode = 'simple';
const options = this._getProfileOptions(optionsContext);
- const details = {matchType: 'exact'};
+ const details = {matchType: 'exact', deinflect: true};
const findTermsOptions = this._getTranslatorFindTermsOptions(mode, details, options);
const results = [];
let previousUngroupedSegment = null;
@@ -1959,8 +1959,9 @@ class Backend {
}
_getTranslatorFindTermsOptions(mode, details, options) {
- let {matchType} = details;
+ let {matchType, deinflect} = details;
if (typeof matchType !== 'string') { matchType = 'exact'; }
+ if (typeof deinflect !== 'boolean') { deinflect = true; }
const enabledDictionaryMap = this._getTranslatorEnabledDictionaryMap(options);
const {
general: {mainDictionary, sortFrequencyDictionary, sortFrequencyDictionaryOrder},
@@ -1988,6 +1989,7 @@ class Backend {
}
return {
matchType,
+ deinflect,
mainDictionary,
sortFrequencyDictionary,
sortFrequencyDictionaryOrder,