summaryrefslogtreecommitdiff
path: root/ext/js/language/languages.js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-03-22 15:27:35 +0100
committerGitHub <noreply@github.com>2024-03-22 14:27:35 +0000
commitd2e9841f96ebff61d4a5c26a322484f6268115f1 (patch)
tree3c1351fa3b25994eab8456ea8457ee153bb98aa9 /ext/js/language/languages.js
parent7681131782d958997663b1fb443a3e32e8eef550 (diff)
expand deinflection format (#745)
* abstract deinflections * undo redundant changes * remove cast * switch to js * MultiLanguageTransformer * comments * comments * fix test * suffixInflection * fix bench * substring instead of replace * without heuristic * suffixMap * add other language deinflections * wip * catch cycles * fix tests * uninflect to deinflect * use less regex * add suru masu stem deinflection
Diffstat (limited to 'ext/js/language/languages.js')
-rwxr-xr-xext/js/language/languages.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/ext/js/language/languages.js b/ext/js/language/languages.js
index 63bbc791..4b196c2c 100755
--- a/ext/js/language/languages.js
+++ b/ext/js/language/languages.js
@@ -22,8 +22,8 @@ import {languageDescriptorMap} from './language-descriptors.js';
*/
export function getLanguageSummaries() {
const results = [];
- for (const {name, iso, exampleText, languageTransformsFile} of languageDescriptorMap.values()) {
- results.push({name, iso, exampleText, languageTransformsFile});
+ for (const {name, iso, exampleText} of languageDescriptorMap.values()) {
+ results.push({name, iso, exampleText});
}
return results;
}
@@ -58,3 +58,16 @@ export function isTextLookupWorthy(text, language) {
if (typeof descriptor === 'undefined') { return false; }
return typeof descriptor.isTextLookupWorthy === 'undefined' || descriptor.isTextLookupWorthy(text);
}
+
+/**
+ * @returns {import('language').LanguageAndTransforms[]}
+ */
+export function getAllLanguageTransformDescriptors() {
+ const results = [];
+ for (const {iso, languageTransforms} of languageDescriptorMap.values()) {
+ if (languageTransforms) {
+ results.push({iso, languageTransforms});
+ }
+ }
+ return results;
+}