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
288 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
289 if ( isset( $grammarForms[
'kk-tr'][$case][$word] ) ) {
290 return $grammarForms[
'kk-tr'][$case][$word];
292 if ( isset( $grammarForms[
'kk-latn'][$case][$word] ) ) {
293 return $grammarForms[
'kk-latn'][$case][$word];
297 $frontVowels = [
"e",
"ö",
"ü",
"i",
"ä",
"é" ];
298 $backVowels = [
"a",
"o",
"u",
"ı" ];
299 $allVowels = [
"e",
"ö",
"ü",
"i",
"ä",
"é",
"a",
"o",
"u",
"ı" ];
301 $Nasals = [
"m",
"n",
"ñ" ];
302 $Sonants = [
"ï",
"y",
"ý",
"l",
"r",
"w" ];
303 $Consonants = [
"p",
"f",
"k",
"q",
"t",
"ş",
"s",
"x",
"c",
"ç",
"b",
"v",
"g",
"d" ];
304 $Sibilants = [
"j",
"z" ];
305 $Sonorants = [
"ï",
"y",
"ý",
"l",
"r",
"w",
"m",
"n",
"ñ",
"j",
"z" ];
308 $firstPerson = [
"m",
"ñ" ];
309 $secondPerson = [
"z" ];
310 $thirdPerson = [
"ı",
"i" ];
312 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
317 case "genitive": # ilik
318 if ( in_array( $wordEnding, $Consonants ) ) {
319 if ( in_array( $wordLastVowel, $frontVowels ) ) {
321 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
324 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
325 if ( in_array( $wordLastVowel, $frontVowels ) ) {
327 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
330 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
331 if ( in_array( $wordLastVowel, $frontVowels ) ) {
333 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
340 case "dative": # barıs
341 if ( in_array( $wordEnding, $Consonants ) ) {
342 if ( in_array( $wordLastVowel, $frontVowels ) ) {
344 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
347 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
348 if ( in_array( $wordLastVowel, $frontVowels ) ) {
350 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
357 case "possessive dative": # täweldık + barıs
358 if ( in_array( $wordEnding, $firstPerson ) ) {
359 if ( in_array( $wordLastVowel, $frontVowels ) ) {
361 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
364 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
365 if ( in_array( $wordLastVowel, $frontVowels ) ) {
367 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
370 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
371 if ( in_array( $wordLastVowel, $frontVowels ) ) {
373 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
380 case "accusative": # tabıs
381 if ( in_array( $wordEnding, $Consonants ) ) {
382 if ( in_array( $wordLastVowel, $frontVowels ) ) {
384 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
387 } elseif ( in_array( $wordEnding, $allVowels ) ) {
388 if ( in_array( $wordLastVowel, $frontVowels ) ) {
390 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
393 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
394 if ( in_array( $wordLastVowel, $frontVowels ) ) {
396 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
403 case "possessive accusative": # täweldık + tabıs
404 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
405 if ( in_array( $wordLastVowel, $frontVowels ) ) {
407 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
410 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
416 case "locative": # jatıs
417 if ( in_array( $wordEnding, $Consonants ) ) {
418 if ( in_array( $wordLastVowel, $frontVowels ) ) {
420 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
423 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
424 if ( in_array( $wordLastVowel, $frontVowels ) ) {
426 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
433 case "possessive locative": # täweldık + jatıs
434 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
435 if ( in_array( $wordLastVowel, $frontVowels ) ) {
437 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
440 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
441 if ( in_array( $wordLastVowel, $frontVowels ) ) {
443 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
450 case "ablative": # şığıs
451 if ( in_array( $wordEnding, $Consonants ) ) {
452 if ( in_array( $wordLastVowel, $frontVowels ) ) {
454 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
457 } elseif ( in_array( $wordEnding, $allVowels )
458 || in_array( $wordEnding, $Sonants )
459 || in_array( $wordEnding, $Sibilants )
461 if ( in_array( $wordLastVowel, $frontVowels ) ) {
463 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
466 } elseif ( in_array( $wordEnding, $Nasals ) ) {
467 if ( in_array( $wordLastVowel, $frontVowels ) ) {
469 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
476 case "possessive ablative": # täweldık + şığıs
477 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
478 if ( in_array( $wordLastVowel, $frontVowels ) ) {
480 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
483 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
484 if ( in_array( $wordLastVowel, $frontVowels ) ) {
486 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
493 case "comitative": # kömektes
494 if ( in_array( $wordEnding, $Consonants ) ) {
496 } elseif ( in_array( $wordEnding, $allVowels )
497 || in_array( $wordEnding, $Nasals )
498 || in_array( $wordEnding, $Sonants )
501 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
507 case "possessive comitative": # täweldık + kömektes
508 if ( in_array( $wordEnding, $Consonants ) ) {
510 } elseif ( in_array( $wordEnding, $allVowels )
511 || in_array( $wordEnding, $Nasals )
512 || in_array( $wordEnding, $Sonants )
515 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
519 default: # dc0 #nominative #ataw
531 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
532 if ( isset( $grammarForms[
'kk-cn'][$case][$word] ) ) {
533 return $grammarForms[
'kk-cn'][$case][$word];
535 if ( isset( $grammarForms[
'kk-arab'][$case][$word] ) ) {
536 return $grammarForms[
'kk-arab'][$case][$word];
540 $frontVowels = [
"ە",
"ٶ",
"ٷ",
"ٸ",
"ٵ",
"ە" ];
541 $backVowels = [
"ا",
"و",
"ۇ",
"ى" ];
542 $allVowels = [
"ە",
"ٶ",
"ٷ",
"ٸ",
"ٵ",
"ە",
"ا",
"و",
"ۇ",
"ى" ];
544 $Nasals = [
"م",
"ن",
"ڭ" ];
545 $Sonants = [
"ي",
"ي",
"ل",
"ر",
"ۋ" ];
546 $Consonants = [
"پ",
"ف",
"ك",
"ق",
"ت",
"ش",
"س",
"ح",
"تس",
"چ",
"ب",
"ۆ",
"گ",
"د" ];
547 $Sibilants = [
"ج",
"ز" ];
548 $Sonorants = [
"ي",
"ي",
"ل",
"ر",
"ۋ",
"م",
"ن",
"ڭ",
"ج",
"ز" ];
551 $firstPerson = [
"م",
"ڭ" ];
552 $secondPerson = [
"ز" ];
553 $thirdPerson = [
"ى",
"ٸ" ];
555 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
560 case "genitive": # ilik
561 if ( in_array( $wordEnding, $Consonants ) ) {
562 if ( in_array( $wordLastVowel, $frontVowels ) ) {
564 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
567 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
568 if ( in_array( $wordLastVowel, $frontVowels ) ) {
570 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
573 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
574 if ( in_array( $wordLastVowel, $frontVowels ) ) {
576 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
583 case "dative": # barıs
584 if ( in_array( $wordEnding, $Consonants ) ) {
585 if ( in_array( $wordLastVowel, $frontVowels ) ) {
587 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
590 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
591 if ( in_array( $wordLastVowel, $frontVowels ) ) {
593 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
600 case "possessive dative": # täweldık + barıs
601 if ( in_array( $wordEnding, $firstPerson ) ) {
602 if ( in_array( $wordLastVowel, $frontVowels ) ) {
604 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
607 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
608 if ( in_array( $wordLastVowel, $frontVowels ) ) {
610 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
613 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
614 if ( in_array( $wordLastVowel, $frontVowels ) ) {
616 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
622 case "accusative": # tabıs
623 if ( in_array( $wordEnding, $Consonants ) ) {
624 if ( in_array( $wordLastVowel, $frontVowels ) ) {
626 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
629 } elseif ( in_array( $wordEnding, $allVowels ) ) {
630 if ( in_array( $wordLastVowel, $frontVowels ) ) {
632 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
635 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
636 if ( in_array( $wordLastVowel, $frontVowels ) ) {
638 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
645 case "possessive accusative": # täweldık + tabıs
646 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
647 if ( in_array( $wordLastVowel, $frontVowels ) ) {
649 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
652 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
658 case "locative": # jatıs
659 if ( in_array( $wordEnding, $Consonants ) ) {
660 if ( in_array( $wordLastVowel, $frontVowels ) ) {
662 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
665 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
666 if ( in_array( $wordLastVowel, $frontVowels ) ) {
668 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
675 case "possessive locative": # täweldık + jatıs
676 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
677 if ( in_array( $wordLastVowel, $frontVowels ) ) {
679 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
682 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
683 if ( in_array( $wordLastVowel, $frontVowels ) ) {
685 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
692 case "ablative": # şığıs
693 if ( in_array( $wordEnding, $Consonants ) ) {
694 if ( in_array( $wordLastVowel, $frontVowels ) ) {
696 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
699 } elseif ( in_array( $wordEnding, $allVowels )
700 || in_array( $wordEnding, $Sonants )
701 || in_array( $wordEnding, $Sibilants )
703 if ( in_array( $wordLastVowel, $frontVowels ) ) {
705 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
708 } elseif ( in_array( $wordEnding, $Nasals ) ) {
709 if ( in_array( $wordLastVowel, $frontVowels ) ) {
711 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
718 case "possessive ablative": # täweldık + şığıs
719 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
720 if ( in_array( $wordLastVowel, $frontVowels ) ) {
722 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
725 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
726 if ( in_array( $wordLastVowel, $frontVowels ) ) {
728 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
735 case "comitative": # kömektes
736 if ( in_array( $wordEnding, $Consonants ) ) {
738 } elseif ( in_array( $wordEnding, $allVowels )
739 || in_array( $wordEnding, $Nasals )
740 || in_array( $wordEnding, $Sonants )
743 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
748 case "possessive comitative": # täweldık + kömektes
749 if ( in_array( $wordEnding, $Consonants ) ) {
751 } elseif ( in_array( $wordEnding, $allVowels )
752 || in_array( $wordEnding, $Nasals )
753 || in_array( $wordEnding, $Sonants )
756 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
761 default: # dc0 #nominative #ataw