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 ) ) {
95 case "dative": # barıs
96 if ( in_array( $wordEnding, $Consonants ) ) {
97 if ( in_array( $wordLastVowel, $frontVowels ) ) {
99 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
102 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
103 if ( in_array( $wordLastVowel, $frontVowels ) ) {
105 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
111 case "possessive dative": # täweldık + barıs
112 if ( in_array( $wordEnding, $firstPerson ) ) {
113 if ( in_array( $wordLastVowel, $frontVowels ) ) {
115 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
118 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
119 if ( in_array( $wordLastVowel, $frontVowels ) ) {
121 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
124 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
125 if ( in_array( $wordLastVowel, $frontVowels ) ) {
127 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
133 case "accusative": # tabıs
134 if ( in_array( $wordEnding, $Consonants ) ) {
135 if ( in_array( $wordLastVowel, $frontVowels ) ) {
137 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
140 } elseif ( in_array( $wordEnding, $allVowels ) ) {
141 if ( in_array( $wordLastVowel, $frontVowels ) ) {
143 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
146 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
147 if ( in_array( $wordLastVowel, $frontVowels ) ) {
149 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
155 case "possessive accusative": # täweldık + tabıs
156 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
157 if ( in_array( $wordLastVowel, $frontVowels ) ) {
159 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
162 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
167 case "locative": # jatıs
168 if ( in_array( $wordEnding, $Consonants ) ) {
169 if ( in_array( $wordLastVowel, $frontVowels ) ) {
171 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
174 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
175 if ( in_array( $wordLastVowel, $frontVowels ) ) {
177 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
183 case "possessive locative": # täweldık + jatıs
184 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
185 if ( in_array( $wordLastVowel, $frontVowels ) ) {
187 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
190 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
191 if ( in_array( $wordLastVowel, $frontVowels ) ) {
193 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
199 case "ablative": # şığıs
200 if ( in_array( $wordEnding, $Consonants ) ) {
201 if ( in_array( $wordLastVowel, $frontVowels ) ) {
203 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
206 } elseif ( in_array( $wordEnding, $allVowels )
207 || in_array( $wordEnding, $Sonants )
208 || in_array( $wordEnding, $Sibilants )
210 if ( in_array( $wordLastVowel, $frontVowels ) ) {
212 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
215 } elseif ( in_array( $wordEnding, $Nasals ) ) {
216 if ( in_array( $wordLastVowel, $frontVowels ) ) {
218 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
224 case "possessive ablative": # täweldık + şığıs
225 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
226 if ( in_array( $wordLastVowel, $frontVowels ) ) {
228 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
231 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
232 if ( in_array( $wordLastVowel, $frontVowels ) ) {
234 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
240 case "comitative": # kömektes
241 if ( in_array( $wordEnding, $Consonants ) ) {
243 } elseif ( in_array( $wordEnding, $allVowels )
244 || in_array( $wordEnding, $Nasals )
245 || in_array( $wordEnding, $Sonants )
248 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
253 case "possessive comitative": # täweldık + kömektes
254 if ( in_array( $wordEnding, $Consonants ) ) {
256 } elseif ( in_array( $wordEnding, $allVowels )
257 || in_array( $wordEnding, $Nasals )
258 || in_array( $wordEnding, $Sonants )
261 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
265 default: # dc0 #nominative #ataw
277 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
278 if ( isset( $grammarForms[
'kk-tr'][$case][$word] ) ) {
279 return $grammarForms[
'kk-tr'][$case][$word];
281 if ( isset( $grammarForms[
'kk-latn'][$case][$word] ) ) {
282 return $grammarForms[
'kk-latn'][$case][$word];
286 $frontVowels = [
"e",
"ö",
"ü",
"i",
"ä",
"é" ];
287 $backVowels = [
"a",
"o",
"u",
"ı" ];
288 $allVowels = [
"e",
"ö",
"ü",
"i",
"ä",
"é",
"a",
"o",
"u",
"ı" ];
290 $Nasals = [
"m",
"n",
"ñ" ];
291 $Sonants = [
"ï",
"y",
"ý",
"l",
"r",
"w" ];
292 $Consonants = [
"p",
"f",
"k",
"q",
"t",
"ş",
"s",
"x",
"c",
"ç",
"b",
"v",
"g",
"d" ];
293 $Sibilants = [
"j",
"z" ];
294 $Sonorants = [
"ï",
"y",
"ý",
"l",
"r",
"w",
"m",
"n",
"ñ",
"j",
"z" ];
297 $firstPerson = [
"m",
"ñ" ];
298 $secondPerson = [
"z" ];
299 $thirdPerson = [
"ı",
"i" ];
301 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
306 case "genitive": # ilik
307 if ( in_array( $wordEnding, $Consonants ) ) {
308 if ( in_array( $wordLastVowel, $frontVowels ) ) {
310 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
313 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
314 if ( in_array( $wordLastVowel, $frontVowels ) ) {
316 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
319 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
320 if ( in_array( $wordLastVowel, $frontVowels ) ) {
322 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
328 case "dative": # barıs
329 if ( in_array( $wordEnding, $Consonants ) ) {
330 if ( in_array( $wordLastVowel, $frontVowels ) ) {
332 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
335 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
336 if ( in_array( $wordLastVowel, $frontVowels ) ) {
338 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
344 case "possessive dative": # täweldık + barıs
345 if ( in_array( $wordEnding, $firstPerson ) ) {
346 if ( in_array( $wordLastVowel, $frontVowels ) ) {
348 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
351 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
352 if ( in_array( $wordLastVowel, $frontVowels ) ) {
354 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
357 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
358 if ( in_array( $wordLastVowel, $frontVowels ) ) {
360 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
366 case "accusative": # tabıs
367 if ( in_array( $wordEnding, $Consonants ) ) {
368 if ( in_array( $wordLastVowel, $frontVowels ) ) {
370 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
373 } elseif ( in_array( $wordEnding, $allVowels ) ) {
374 if ( in_array( $wordLastVowel, $frontVowels ) ) {
376 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
379 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
380 if ( in_array( $wordLastVowel, $frontVowels ) ) {
382 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
388 case "possessive accusative": # täweldık + tabıs
389 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
390 if ( in_array( $wordLastVowel, $frontVowels ) ) {
392 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
395 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
400 case "locative": # jatıs
401 if ( in_array( $wordEnding, $Consonants ) ) {
402 if ( in_array( $wordLastVowel, $frontVowels ) ) {
404 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
407 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
408 if ( in_array( $wordLastVowel, $frontVowels ) ) {
410 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
416 case "possessive locative": # täweldık + jatıs
417 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
418 if ( in_array( $wordLastVowel, $frontVowels ) ) {
420 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
423 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
424 if ( in_array( $wordLastVowel, $frontVowels ) ) {
426 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
432 case "ablative": # şığıs
433 if ( in_array( $wordEnding, $Consonants ) ) {
434 if ( in_array( $wordLastVowel, $frontVowels ) ) {
436 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
439 } elseif ( in_array( $wordEnding, $allVowels )
440 || in_array( $wordEnding, $Sonants )
441 || in_array( $wordEnding, $Sibilants )
443 if ( in_array( $wordLastVowel, $frontVowels ) ) {
445 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
448 } elseif ( in_array( $wordEnding, $Nasals ) ) {
449 if ( in_array( $wordLastVowel, $frontVowels ) ) {
451 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
457 case "possessive ablative": # täweldık + şığıs
458 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
459 if ( in_array( $wordLastVowel, $frontVowels ) ) {
461 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
464 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
465 if ( in_array( $wordLastVowel, $frontVowels ) ) {
467 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
473 case "comitative": # kömektes
474 if ( in_array( $wordEnding, $Consonants ) ) {
476 } elseif ( in_array( $wordEnding, $allVowels )
477 || in_array( $wordEnding, $Nasals )
478 || in_array( $wordEnding, $Sonants )
481 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
486 case "possessive comitative": # täweldık + kömektes
487 if ( in_array( $wordEnding, $Consonants ) ) {
489 } elseif ( in_array( $wordEnding, $allVowels )
490 || in_array( $wordEnding, $Nasals )
491 || in_array( $wordEnding, $Sonants )
494 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
498 default: # dc0 #nominative #ataw
510 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
511 if ( isset( $grammarForms[
'kk-cn'][$case][$word] ) ) {
512 return $grammarForms[
'kk-cn'][$case][$word];
514 if ( isset( $grammarForms[
'kk-arab'][$case][$word] ) ) {
515 return $grammarForms[
'kk-arab'][$case][$word];
519 $frontVowels = [
"ە",
"ٶ",
"ٷ",
"ٸ",
"ٵ",
"ە" ];
520 $backVowels = [
"ا",
"و",
"ۇ",
"ى" ];
521 $allVowels = [
"ە",
"ٶ",
"ٷ",
"ٸ",
"ٵ",
"ە",
"ا",
"و",
"ۇ",
"ى" ];
523 $Nasals = [
"م",
"ن",
"ڭ" ];
524 $Sonants = [
"ي",
"ي",
"ل",
"ر",
"ۋ" ];
525 $Consonants = [
"پ",
"ف",
"ك",
"ق",
"ت",
"ش",
"س",
"ح",
"تس",
"چ",
"ب",
"ۆ",
"گ",
"د" ];
526 $Sibilants = [
"ج",
"ز" ];
527 $Sonorants = [
"ي",
"ي",
"ل",
"ر",
"ۋ",
"م",
"ن",
"ڭ",
"ج",
"ز" ];
530 $firstPerson = [
"م",
"ڭ" ];
531 $secondPerson = [
"ز" ];
532 $thirdPerson = [
"ى",
"ٸ" ];
534 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
539 case "genitive": # ilik
540 if ( in_array( $wordEnding, $Consonants ) ) {
541 if ( in_array( $wordLastVowel, $frontVowels ) ) {
543 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
546 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
547 if ( in_array( $wordLastVowel, $frontVowels ) ) {
549 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
552 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
553 if ( in_array( $wordLastVowel, $frontVowels ) ) {
555 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
561 case "dative": # barıs
562 if ( in_array( $wordEnding, $Consonants ) ) {
563 if ( in_array( $wordLastVowel, $frontVowels ) ) {
565 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
568 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
569 if ( in_array( $wordLastVowel, $frontVowels ) ) {
571 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
577 case "possessive dative": # täweldık + barıs
578 if ( in_array( $wordEnding, $firstPerson ) ) {
579 if ( in_array( $wordLastVowel, $frontVowels ) ) {
581 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
584 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
585 if ( in_array( $wordLastVowel, $frontVowels ) ) {
587 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
590 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
591 if ( in_array( $wordLastVowel, $frontVowels ) ) {
593 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
599 case "accusative": # tabıs
600 if ( in_array( $wordEnding, $Consonants ) ) {
601 if ( in_array( $wordLastVowel, $frontVowels ) ) {
603 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
606 } elseif ( in_array( $wordEnding, $allVowels ) ) {
607 if ( in_array( $wordLastVowel, $frontVowels ) ) {
609 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
612 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
613 if ( in_array( $wordLastVowel, $frontVowels ) ) {
615 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
621 case "possessive accusative": # täweldık + tabıs
622 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
623 if ( in_array( $wordLastVowel, $frontVowels ) ) {
625 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
628 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
633 case "locative": # jatıs
634 if ( in_array( $wordEnding, $Consonants ) ) {
635 if ( in_array( $wordLastVowel, $frontVowels ) ) {
637 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
640 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
641 if ( in_array( $wordLastVowel, $frontVowels ) ) {
643 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
649 case "possessive locative": # täweldık + jatıs
650 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
651 if ( in_array( $wordLastVowel, $frontVowels ) ) {
653 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
656 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
657 if ( in_array( $wordLastVowel, $frontVowels ) ) {
659 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
665 case "ablative": # şığıs
666 if ( in_array( $wordEnding, $Consonants ) ) {
667 if ( in_array( $wordLastVowel, $frontVowels ) ) {
669 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
672 } elseif ( in_array( $wordEnding, $allVowels )
673 || in_array( $wordEnding, $Sonants )
674 || in_array( $wordEnding, $Sibilants )
676 if ( in_array( $wordLastVowel, $frontVowels ) ) {
678 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
681 } elseif ( in_array( $wordEnding, $Nasals ) ) {
682 if ( in_array( $wordLastVowel, $frontVowels ) ) {
684 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
690 case "possessive ablative": # täweldık + şığıs
691 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
692 if ( in_array( $wordLastVowel, $frontVowels ) ) {
694 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
697 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
698 if ( in_array( $wordLastVowel, $frontVowels ) ) {
700 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
706 case "comitative": # kömektes
707 if ( in_array( $wordEnding, $Consonants ) ) {
709 } elseif ( in_array( $wordEnding, $allVowels )
710 || in_array( $wordEnding, $Nasals )
711 || in_array( $wordEnding, $Sonants )
714 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
719 case "possessive comitative": # täweldık + kömektes
720 if ( in_array( $wordEnding, $Consonants ) ) {
722 } elseif ( in_array( $wordEnding, $allVowels )
723 || in_array( $wordEnding, $Nasals )
724 || in_array( $wordEnding, $Sonants )
727 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
731 default: # dc0 #nominative #ataw