From 5b565adc4f284d0428b4c532dd9cd30c7225815a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Vukovi=C4=87?= Date: Wed, 17 Jul 2024 11:51:56 +0200 Subject: [PATCH] [it] preprocess italian diacritics (#1237) --- ext/js/language/language-descriptors.js | 5 ++++- types/ext/language-descriptors.d.ts | 26 ++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js index 5aea0572f5..b21772222f 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -143,7 +143,10 @@ const languageDescriptors = [ iso639_3: 'ita', name: 'Italian', exampleText: 'leggere', - textPreprocessors: capitalizationPreprocessors, + textPreprocessors: { + ...capitalizationPreprocessors, + removeAlphabeticDiacritics, + }, }, { iso: 'la', diff --git a/types/ext/language-descriptors.d.ts b/types/ext/language-descriptors.d.ts index a88f0f6611..426da54202 100644 --- a/types/ext/language-descriptors.d.ts +++ b/types/ext/language-descriptors.d.ts @@ -62,6 +62,10 @@ type CapitalizationPreprocessors = { decapitalize: TextProcessor; }; +type AlphabeticDiacriticsProcessor = { + removeAlphabeticDiacritics: TextProcessor; +}; + /** * This is a mapping of the iso tag to all of the text processors for that language. * Any new language should be added to this object. @@ -98,9 +102,7 @@ type AllTextProcessors = { pre: CapitalizationPreprocessors; }; grc: { - pre: CapitalizationPreprocessors & { - removeAlphabeticDiacritics: TextProcessor; - }; + pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; hu: { pre: CapitalizationPreprocessors; @@ -109,12 +111,10 @@ type AllTextProcessors = { pre: CapitalizationPreprocessors; }; it: { - pre: CapitalizationPreprocessors; + pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; la: { - pre: CapitalizationPreprocessors & { - removeAlphabeticDiacritics: TextProcessor; - }; + pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; lo: Record; ja: { @@ -149,9 +149,7 @@ type AllTextProcessors = { pre: CapitalizationPreprocessors; }; ro: { - pre: CapitalizationPreprocessors & { - removeAlphabeticDiacritics: TextProcessor; - }; + pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; ru: { pre: CapitalizationPreprocessors & { @@ -160,9 +158,7 @@ type AllTextProcessors = { }; }; sga: { - pre: CapitalizationPreprocessors & { - removeAlphabeticDiacritics: TextProcessor; - }; + pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; sh: { pre: CapitalizationPreprocessors & { @@ -177,9 +173,7 @@ type AllTextProcessors = { }; th: Record; tl: { - pre: CapitalizationPreprocessors & { - removeAlphabeticDiacritics: TextProcessor; - }; + pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; tr: { pre: CapitalizationPreprocessors;