36 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
37 if ( isset( $grammarForms[
'tyv'][$case][$word] ) ) {
38 return $grammarForms[
'tyv'][$case][$word];
42 $allVowels = [
"е",
"и",
"э",
"ө",
"ү",
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
43 $frontVowels = [
"е",
"и",
"э",
"ө",
"ү" ];
44 $backVowels = [
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
45 $unroundFrontVowels = [
"е",
"и",
"э" ];
46 $roundFrontVowels = [
"ө",
"ү" ];
47 $unroundBackVowels = [
"а",
"ы",
"я" ];
48 $roundBackVowels = [
"ё",
"о",
"у",
"ю" ];
49 $unvoicedPhonemes = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х" ];
50 $directiveUnvoicedStems = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х",
"л",
"м",
"н",
"ң" ];
51 $directiveVoicedStems = [
"д",
"б",
"з",
"ж",
"г",
"р",
"й" ];
54 $ar = mb_str_split( $word, 1 );
57 $wordEnding = end( $ar );
60 $wordLastVowel =
null;
61 for ( $i = count( $ar ); $i--; ) {
62 if ( in_array( $ar[$i], $allVowels,
true ) ) {
63 $wordLastVowel = $ar[$i];
71 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
72 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
74 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
76 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
78 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
81 } elseif ( $wordEnding ===
"л" ) {
82 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
84 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
86 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
88 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
92 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
94 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
96 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
98 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
105 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
106 if ( in_array( $wordLastVowel, $frontVowels ) ) {
108 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
112 if ( in_array( $wordLastVowel, $frontVowels ) ) {
114 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
121 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
122 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
124 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
126 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
128 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
131 } elseif ( $wordEnding ===
"л" ) {
132 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
134 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
136 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
138 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
142 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
144 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
146 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
148 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
155 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
156 if ( in_array( $wordLastVowel, $frontVowels ) ) {
158 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
162 if ( in_array( $wordLastVowel, $frontVowels ) ) {
164 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
171 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
172 if ( in_array( $wordLastVowel, $frontVowels ) ) {
174 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
178 if ( in_array( $wordLastVowel, $frontVowels ) ) {
180 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
187 if ( in_array( $wordEnding, $directiveVoicedStems ) ) {
189 } elseif ( in_array( $wordEnding, $directiveUnvoicedStems ) ) {
195 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
196 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
198 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
200 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
202 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
206 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
208 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
210 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
212 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {