From 273c2f22603abe563435a0f1d7a84c0d9037fe2c Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Sat, 13 Jan 2024 12:41:38 +0100 Subject: 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 --- ext/js/background/backend.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ext/js/background') 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; -- cgit v1.2.3