42 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
43 if ( isset( $grammarForms[
'tyv'][$case][$word] ) ) {
44 return $grammarForms[
'tyv'][$case][$word];
48 $allVowels = [
"е",
"и",
"э",
"ө",
"ү",
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
49 $frontVowels = [
"е",
"и",
"э",
"ө",
"ү" ];
50 $backVowels = [
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
51 $unroundFrontVowels = [
"е",
"и",
"э" ];
52 $roundFrontVowels = [
"ө",
"ү" ];
53 $unroundBackVowels = [
"а",
"ы",
"я" ];
54 $roundBackVowels = [
"ё",
"о",
"у",
"ю" ];
55 $unvoicedPhonemes = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х" ];
56 $directiveUnvoicedStems = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х",
"л",
"м",
"н",
"ң" ];
57 $directiveVoicedStems = [
"д",
"б",
"з",
"ж",
"г",
"р",
"й" ];
60 $ar = mb_str_split( $word, 1 );
63 $wordEnding = end( $ar );
66 $wordLastVowel =
null;
67 for ( $i = count( $ar ); $i--; ) {
68 if ( in_array( $ar[$i], $allVowels,
true ) ) {
69 $wordLastVowel = $ar[$i];
77 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
78 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
79 $word = $word .
"түң";
80 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
81 $word = $word .
"тиң";
82 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
83 $word = $word .
"туң";
84 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
85 $word = $word .
"тың";
87 } elseif ( $wordEnding ===
"л" ) {
88 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
89 $word = $word .
"дүң";
90 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
91 $word = $word .
"диң";
92 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
93 $word = $word .
"дуң";
94 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
95 $word = $word .
"дың";
98 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
99 $word = $word .
"нүң";
100 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
101 $word = $word .
"ниң";
102 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
103 $word = $word .
"нуң";
104 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
105 $word = $word .
"ның";
110 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
111 if ( in_array( $wordLastVowel, $frontVowels ) ) {
112 $word = $word .
"ке";
113 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
114 $word = $word .
"ка";
117 if ( in_array( $wordLastVowel, $frontVowels ) ) {
118 $word = $word .
"ге";
119 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
120 $word = $word .
"га";
125 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
126 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
127 $word = $word .
"тү";
128 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
129 $word = $word .
"ти";
130 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
131 $word = $word .
"ту";
132 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
133 $word = $word .
"ты";
135 } elseif ( $wordEnding ===
"л" ) {
136 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
137 $word = $word .
"дү";
138 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
139 $word = $word .
"ди";
140 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
141 $word = $word .
"ду";
142 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
143 $word = $word .
"ды";
146 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
147 $word = $word .
"нү";
148 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
149 $word = $word .
"ни";
150 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
151 $word = $word .
"ну";
152 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
153 $word = $word .
"ны";
158 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
159 if ( in_array( $wordLastVowel, $frontVowels ) ) {
160 $word = $word .
"те";
161 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
162 $word = $word .
"та";
165 if ( in_array( $wordLastVowel, $frontVowels ) ) {
166 $word = $word .
"де";
167 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
168 $word = $word .
"да";
173 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
174 if ( in_array( $wordLastVowel, $frontVowels ) ) {
175 $word = $word .
"тен";
176 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
177 $word = $word .
"тан";
180 if ( in_array( $wordLastVowel, $frontVowels ) ) {
181 $word = $word .
"ден";
182 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
183 $word = $word .
"дан";
188 if ( in_array( $wordEnding, $directiveVoicedStems ) ) {
189 $word = $word .
"же";
190 } elseif ( in_array( $wordEnding, $directiveUnvoicedStems ) ) {
191 $word = $word .
"че";
195 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
196 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
197 $word = $word .
"түве";
198 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
199 $word = $word .
"тиве";
200 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
201 $word = $word .
"туве";
202 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
203 $word = $word .
"тыве";
206 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
207 $word = $word .
"дүве";
208 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
209 $word = $word .
"диве";
210 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
211 $word = $word .
"дуве";
212 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
213 $word = $word .
"дыве";
Tyvan localization (Тыва дыл)
convertGrammar( $word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
Base class for language-specific code.
A class containing constants representing the names of configuration variables.