Skip to content

Commit e550a16

Browse files
Georgian language support (#2073)
* Added Deinflection Rules for Georgian language Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update language-descriptors.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update language-descriptors.d.ts Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update language-descriptors.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update language-descriptors.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Cleanup formatting * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update georgian-transforms.js Signed-off-by: jasonhoblack <david6treiser@gmail.com> * Update language-descriptors.d.ts Signed-off-by: jasonhoblack <david6treiser@gmail.com> --------- Signed-off-by: jasonhoblack <david6treiser@gmail.com> Co-authored-by: kuuuube <hexagonisalie@gmail.com>
1 parent 47ce57b commit e550a16

3 files changed

Lines changed: 102 additions & 0 deletions

File tree

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright (C) 2025 Yomitan Authors
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
import {suffixInflection} from '../language-transforms.js';
19+
20+
const suffixes = [
21+
'ები',
22+
'ებს',
23+
'ებების', // plural suffixes
24+
'მა', // ergative
25+
'ს', // dative
26+
'ის', // genitive
27+
'ით', // instrumental
28+
'ად', // adverbial
29+
'ო', // vocative
30+
'ში',
31+
'ზე',
32+
'შია',
33+
'ზეა',
34+
];
35+
36+
// Stem completion (for consonant endings)
37+
const stemCompletionRules = [
38+
suffixInflection('გნ', 'გნი', ['n', 'adj'], ['n', 'adj']),
39+
suffixInflection('ნ', 'ნი', ['n', 'adj'], ['n', 'adj']),
40+
];
41+
42+
// Vowel restoration example (optional, extend as needed)
43+
const vowelRestorationRules = [
44+
suffixInflection('გ', 'გა', ['n', 'adj'], ['n', 'adj']),
45+
];
46+
47+
export const georgianTransforms = {
48+
language: 'kat',
49+
conditions: {
50+
v: {
51+
name: 'Verb',
52+
isDictionaryForm: true,
53+
},
54+
n: {
55+
name: 'Noun',
56+
isDictionaryForm: true,
57+
subConditions: ['np', 'ns'],
58+
},
59+
np: {
60+
name: 'Noun plural',
61+
isDictionaryForm: true,
62+
},
63+
ns: {
64+
name: 'Noun singular',
65+
isDictionaryForm: true,
66+
},
67+
adj: {
68+
name: 'Adjective',
69+
isDictionaryForm: true,
70+
},
71+
adv: {
72+
name: 'Adverb',
73+
isDictionaryForm: true,
74+
},
75+
},
76+
transforms: {
77+
nounAdjSuffixStripping: {
78+
name: 'noun-adj-suffix-stripping',
79+
description: 'Strip Georgian noun and adjective declension suffixes',
80+
rules: suffixes.map((suffix) => suffixInflection(suffix, '', ['n', 'adj'], ['n', 'adj'])),
81+
},
82+
nounAdjStemCompletion: {
83+
name: 'noun-adj-stem-completion',
84+
description: 'Restore nominative suffix -ი for consonant-ending noun/adjective stems',
85+
rules: stemCompletionRules,
86+
},
87+
vowelRestoration: {
88+
name: 'vowel-restoration',
89+
description: 'Restore truncated vowels if applicable',
90+
rules: vowelRestorationRules,
91+
},
92+
},
93+
};

ext/js/language/language-descriptors.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
} from './ja/japanese-text-preprocessors.js';
5050
import {japaneseTransforms} from './ja/japanese-transforms.js';
5151
import {isStringPartiallyJapanese} from './ja/japanese.js';
52+
import {georgianTransforms} from './ka/georgian-transforms.js';
5253
import {disassembleHangul, reassembleHangul} from './ko/korean-text-processors.js';
5354
import {koreanTransforms} from './ko/korean-transforms.js';
5455
import {processDiphtongs} from './la/latin-text-preprocessors.js';
@@ -322,6 +323,13 @@ const languageDescriptors = [
322323
},
323324
languageTransforms: japaneseTransforms,
324325
},
326+
{
327+
iso: 'ka',
328+
iso639_3: 'kat',
329+
name: 'Georgian',
330+
exampleText: 'კითხვა', // Georgian for “read”
331+
languageTransforms: georgianTransforms,
332+
},
325333
{
326334
iso: 'kn',
327335
iso639_3: 'kan',

types/ext/language-descriptors.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ type AllTextProcessors = {
183183
standardizeKanji: TextProcessor<boolean>;
184184
};
185185
};
186+
ka: Record<string, never>;
186187
ko: {
187188
pre: {
188189
disassembleHangul: TextProcessor<boolean>;

0 commit comments

Comments
 (0)