45 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
46 if ( isset( $grammarForms[
'kk-kz'][$case][$word] ) ) {
47 return $grammarForms[
'kk-kz'][$case][$word];
49 if ( isset( $grammarForms[
'kk-cyrl'][$case][$word] ) ) {
50 return $grammarForms[
'kk-cyrl'][$case][$word];
54 $frontVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"я",
"ё",
"и" ];
55 $backVowels = [
"а",
"о",
"ұ",
"ы" ];
56 $allVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"а",
"о",
"ұ",
"ы",
"я",
"ё",
"и" ];
58 $Nasals = [
"м",
"н",
"ң" ];
59 $Sonants = [
"и",
"й",
"л",
"р",
"у",
"ю" ];
60 $Consonants = [
"п",
"ф",
"к",
"қ",
"т",
"ш",
"с",
"х",
"ц",
"ч",
"щ",
"б",
"в",
"г",
"д" ];
61 $Sibilants = [
"ж",
"з" ];
62 $Sonorants = [
"и",
"й",
"л",
"р",
"у",
"ю",
"м",
"н",
"ң",
"ж",
"з" ];
65 $firstPerson = [
"м",
"ң" ];
66 $secondPerson = [
"з" ];
67 $thirdPerson = [
"ы",
"і" ];
69 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
74 case "genitive": # ilik
75 if ( in_array( $wordEnding, $Consonants ) ) {
76 if ( in_array( $wordLastVowel, $frontVowels ) ) {
78 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
81 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
82 if ( in_array( $wordLastVowel, $frontVowels ) ) {
84 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
87 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
88 if ( in_array( $wordLastVowel, $frontVowels ) ) {
90 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
97 case "dative": # barıs
98 if ( in_array( $wordEnding, $Consonants ) ) {
99 if ( in_array( $wordLastVowel, $frontVowels ) ) {
101 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
104 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
105 if ( in_array( $wordLastVowel, $frontVowels ) ) {
107 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
114 case "possessive dative": # täweldık + barıs
115 if ( in_array( $wordEnding, $firstPerson ) ) {
116 if ( in_array( $wordLastVowel, $frontVowels ) ) {
118 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
121 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
122 if ( in_array( $wordLastVowel, $frontVowels ) ) {
124 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
127 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
128 if ( in_array( $wordLastVowel, $frontVowels ) ) {
130 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
137 case "accusative": # tabıs
138 if ( in_array( $wordEnding, $Consonants ) ) {
139 if ( in_array( $wordLastVowel, $frontVowels ) ) {
141 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
144 } elseif ( in_array( $wordEnding, $allVowels ) ) {
145 if ( in_array( $wordLastVowel, $frontVowels ) ) {
147 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
150 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
151 if ( in_array( $wordLastVowel, $frontVowels ) ) {
153 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
160 case "possessive accusative": # täweldık + tabıs
161 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
162 if ( in_array( $wordLastVowel, $frontVowels ) ) {
164 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
167 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
173 case "locative": # jatıs
174 if ( in_array( $wordEnding, $Consonants ) ) {
175 if ( in_array( $wordLastVowel, $frontVowels ) ) {
177 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
180 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
181 if ( in_array( $wordLastVowel, $frontVowels ) ) {
183 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
190 case "possessive locative": # täweldık + jatıs
191 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
192 if ( in_array( $wordLastVowel, $frontVowels ) ) {
194 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
197 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
198 if ( in_array( $wordLastVowel, $frontVowels ) ) {
200 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
207 case "ablative": # şığıs
208 if ( in_array( $wordEnding, $Consonants ) ) {
209 if ( in_array( $wordLastVowel, $frontVowels ) ) {
211 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
214 } elseif ( in_array( $wordEnding, $allVowels )
215 || in_array( $wordEnding, $Sonants )
216 || in_array( $wordEnding, $Sibilants )
218 if ( in_array( $wordLastVowel, $frontVowels ) ) {
220 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
223 } elseif ( in_array( $wordEnding, $Nasals ) ) {
224 if ( in_array( $wordLastVowel, $frontVowels ) ) {
226 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
233 case "possessive ablative": # täweldık + şığıs
234 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
235 if ( in_array( $wordLastVowel, $frontVowels ) ) {
237 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
240 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
241 if ( in_array( $wordLastVowel, $frontVowels ) ) {
243 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
250 case "comitative": # kömektes
251 if ( in_array( $wordEnding, $Consonants ) ) {
253 } elseif ( in_array( $wordEnding, $allVowels )
254 || in_array( $wordEnding, $Nasals )
255 || in_array( $wordEnding, $Sonants )
258 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
263 case "possessive comitative": # täweldık + kömektes
264 if ( in_array( $wordEnding, $Consonants ) ) {
266 } elseif ( in_array( $wordEnding, $allVowels )
267 || in_array( $wordEnding, $Nasals )
268 || in_array( $wordEnding, $Sonants )
271 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
276 default: # dc0 #nominative #ataw