44 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
45 if ( isset( $grammarForms[
'kk-kz'][$case][$word] ) ) {
46 return $grammarForms[
'kk-kz'][$case][$word];
48 if ( isset( $grammarForms[
'kk-cyrl'][$case][$word] ) ) {
49 return $grammarForms[
'kk-cyrl'][$case][$word];
53 $frontVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"я",
"ё",
"и" ];
54 $backVowels = [
"а",
"о",
"ұ",
"ы" ];
55 $allVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"а",
"о",
"ұ",
"ы",
"я",
"ё",
"и" ];
57 $Nasals = [
"м",
"н",
"ң" ];
58 $Sonants = [
"и",
"й",
"л",
"р",
"у",
"ю" ];
59 $Consonants = [
"п",
"ф",
"к",
"қ",
"т",
"ш",
"с",
"х",
"ц",
"ч",
"щ",
"б",
"в",
"г",
"д" ];
60 $Sibilants = [
"ж",
"з" ];
61 $Sonorants = [
"и",
"й",
"л",
"р",
"у",
"ю",
"м",
"н",
"ң",
"ж",
"з" ];
64 $firstPerson = [
"м",
"ң" ];
65 $secondPerson = [
"з" ];
66 $thirdPerson = [
"ы",
"і" ];
68 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
73 case "genitive": # ilik
74 if ( in_array( $wordEnding, $Consonants ) ) {
75 if ( in_array( $wordLastVowel, $frontVowels ) ) {
77 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
80 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
81 if ( in_array( $wordLastVowel, $frontVowels ) ) {
83 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
86 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
87 if ( in_array( $wordLastVowel, $frontVowels ) ) {
89 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
96 case "dative": # barıs
97 if ( in_array( $wordEnding, $Consonants ) ) {
98 if ( in_array( $wordLastVowel, $frontVowels ) ) {
100 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
103 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
104 if ( in_array( $wordLastVowel, $frontVowels ) ) {
106 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
113 case "possessive dative": # täweldık + barıs
114 if ( in_array( $wordEnding, $firstPerson ) ) {
115 if ( in_array( $wordLastVowel, $frontVowels ) ) {
117 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
120 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
121 if ( in_array( $wordLastVowel, $frontVowels ) ) {
123 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
126 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
127 if ( in_array( $wordLastVowel, $frontVowels ) ) {
129 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
136 case "accusative": # tabıs
137 if ( in_array( $wordEnding, $Consonants ) ) {
138 if ( in_array( $wordLastVowel, $frontVowels ) ) {
140 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
143 } elseif ( in_array( $wordEnding, $allVowels ) ) {
144 if ( in_array( $wordLastVowel, $frontVowels ) ) {
146 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
149 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
150 if ( in_array( $wordLastVowel, $frontVowels ) ) {
152 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
159 case "possessive accusative": # täweldık + tabıs
160 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
161 if ( in_array( $wordLastVowel, $frontVowels ) ) {
163 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
166 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
172 case "locative": # jatıs
173 if ( in_array( $wordEnding, $Consonants ) ) {
174 if ( in_array( $wordLastVowel, $frontVowels ) ) {
176 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
179 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
180 if ( in_array( $wordLastVowel, $frontVowels ) ) {
182 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
189 case "possessive locative": # täweldık + jatıs
190 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
191 if ( in_array( $wordLastVowel, $frontVowels ) ) {
193 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
196 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
197 if ( in_array( $wordLastVowel, $frontVowels ) ) {
199 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
206 case "ablative": # şığıs
207 if ( in_array( $wordEnding, $Consonants ) ) {
208 if ( in_array( $wordLastVowel, $frontVowels ) ) {
210 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
213 } elseif ( in_array( $wordEnding, $allVowels )
214 || in_array( $wordEnding, $Sonants )
215 || in_array( $wordEnding, $Sibilants )
217 if ( in_array( $wordLastVowel, $frontVowels ) ) {
219 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
222 } elseif ( in_array( $wordEnding, $Nasals ) ) {
223 if ( in_array( $wordLastVowel, $frontVowels ) ) {
225 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
232 case "possessive ablative": # täweldık + şığıs
233 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
234 if ( in_array( $wordLastVowel, $frontVowels ) ) {
236 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
239 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
240 if ( in_array( $wordLastVowel, $frontVowels ) ) {
242 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
249 case "comitative": # kömektes
250 if ( in_array( $wordEnding, $Consonants ) ) {
252 } elseif ( in_array( $wordEnding, $allVowels )
253 || in_array( $wordEnding, $Nasals )
254 || in_array( $wordEnding, $Sonants )
257 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
262 case "possessive comitative": # täweldık + kömektes
263 if ( in_array( $wordEnding, $Consonants ) ) {
265 } elseif ( in_array( $wordEnding, $allVowels )
266 || in_array( $wordEnding, $Nasals )
267 || in_array( $wordEnding, $Sonants )
270 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
275 default: # dc0 #nominative #ataw