summaryrefslogtreecommitdiff
path: root/ext/js/language/multi-language-transformer.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/language/multi-language-transformer.js')
-rw-r--r--ext/js/language/multi-language-transformer.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/js/language/multi-language-transformer.js b/ext/js/language/multi-language-transformer.js
index 4e85aa65..fec682a3 100644
--- a/ext/js/language/multi-language-transformer.js
+++ b/ext/js/language/multi-language-transformer.js
@@ -74,4 +74,17 @@ export class MultiLanguageTransformer {
if (typeof languageTransformer === 'undefined') { return [LanguageTransformer.createTransformedText(sourceText, 0, [])]; }
return languageTransformer.transform(sourceText);
}
+
+ /**
+ * @param {string} language
+ * @param {string[]} inflectionRules
+ * @returns {import('dictionary').InflectionRuleChain}
+ */
+ getUserFacingInflectionRules(language, inflectionRules) {
+ const languageTransformer = this._languageTransformers.get(language);
+ if (typeof languageTransformer === 'undefined') {
+ return inflectionRules.map((rule) => ({name: rule}));
+ }
+ return languageTransformer.getUserFacingInflectionRules(inflectionRules);
+ }
}