aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-01-13 12:41:38 +0100
committerGitHub <noreply@github.com>2024-01-13 11:41:38 +0000
commit273c2f22603abe563435a0f1d7a84c0d9037fe2c (patch)
tree0fe7600db81217379fa6e06d38945f10b7aec58a /ext/js/background/backend.js
parent2aea9291d66fd619c484abc2ab04b4350807f308 (diff)
add option to disable part of speech rule check (#438)
* pos filter wip * add part of speech filter option * add part of speech filter option * remove from deinflector * update test * remove return * tie to dictionary * duplicate to welcome page * delete unused html * fix ts * typo
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 3f3c6063..a5a42272 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -2427,7 +2427,8 @@ export class Backend {
enabledDictionaryMap.set(mainDictionary, {
index: enabledDictionaryMap.size,
priority: 0,
- allowSecondarySearches: false
+ allowSecondarySearches: false,
+ partsOfSpeechFilter: true
});
excludeDictionaryDefinitions = new Set();
excludeDictionaryDefinitions.add(mainDictionary);
@@ -2473,10 +2474,12 @@ export class Backend {
const enabledDictionaryMap = new Map();
for (const dictionary of options.dictionaries) {
if (!dictionary.enabled) { continue; }
- enabledDictionaryMap.set(dictionary.name, {
+ const {name, priority, allowSecondarySearches, partsOfSpeechFilter} = dictionary;
+ enabledDictionaryMap.set(name, {
index: enabledDictionaryMap.size,
- priority: dictionary.priority,
- allowSecondarySearches: dictionary.allowSecondarySearches
+ priority,
+ allowSecondarySearches,
+ partsOfSpeechFilter
});
}
return enabledDictionaryMap;