aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/translator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/language/translator.js')
-rw-r--r--ext/js/language/translator.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js
index 36ed8b43..5441294b 100644
--- a/ext/js/language/translator.js
+++ b/ext/js/language/translator.js
@@ -269,10 +269,13 @@ export class Translator {
const databaseEntries = await this._database.findTermsBulk(uniqueDeinflectionTerms, enabledDictionaryMap, matchType);
for (const databaseEntry of databaseEntries) {
+ const entryDictionary = /** @type {import('translation').FindTermDictionary} */ (enabledDictionaryMap.get(databaseEntry.dictionary));
+ const partsOfSpeechFilter = entryDictionary.partsOfSpeechFilter;
+
const definitionRules = Deinflector.rulesToRuleFlags(databaseEntry.rules);
for (const deinflection of uniqueDeinflectionArrays[databaseEntry.index]) {
const deinflectionRules = deinflection.rules;
- if (deinflectionRules === 0 || (definitionRules & deinflectionRules) !== 0) {
+ if (!partsOfSpeechFilter || deinflectionRules === 0 || (definitionRules & deinflectionRules) !== 0) {
deinflection.databaseEntries.push(databaseEntry);
}
}