34 if ( isset( $grammarForms[
'kk-kz'][$case][$word] ) ) {
35 return $grammarForms[
'kk-kz'][$case][$word];
37 if ( isset( $grammarForms[
'kk-cyrl'][$case][$word] ) ) {
38 return $grammarForms[
'kk-cyrl'][$case][$word];
42 $frontVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"я",
"ё",
"и" ];
43 $backVowels = [
"а",
"о",
"ұ",
"ы" ];
44 $allVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"а",
"о",
"ұ",
"ы",
"я",
"ё",
"и" ];
46 $Nasals = [
"м",
"н",
"ң" ];
47 $Sonants = [
"и",
"й",
"л",
"р",
"у",
"ю" ];
48 $Consonants = [
"п",
"ф",
"к",
"қ",
"т",
"ш",
"с",
"х",
"ц",
"ч",
"щ",
"б",
"в",
"г",
"д" ];
49 $Sibilants = [
"ж",
"з" ];
50 $Sonorants = [
"и",
"й",
"л",
"р",
"у",
"ю",
"м",
"н",
"ң",
"ж",
"з" ];
53 $firstPerson = [
"м",
"ң" ];
54 $secondPerson = [
"з" ];
55 $thirdPerson = [
"ы",
"і" ];
57 [ $wordEnding, $wordLastVowel ] = $this->lastLetter( $word, $allVowels );
62 case "genitive": # ilik
63 if ( in_array( $wordEnding, $Consonants ) ) {
64 if ( in_array( $wordLastVowel, $frontVowels ) ) {
66 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
69 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
70 if ( in_array( $wordLastVowel, $frontVowels ) ) {
72 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
75 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
76 if ( in_array( $wordLastVowel, $frontVowels ) ) {
78 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
85 case "dative": # barıs
86 if ( in_array( $wordEnding, $Consonants ) ) {
87 if ( in_array( $wordLastVowel, $frontVowels ) ) {
89 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
92 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
93 if ( in_array( $wordLastVowel, $frontVowels ) ) {
95 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
102 case "possessive dative": # täweldık + barıs
103 if ( in_array( $wordEnding, $firstPerson ) ) {
104 if ( in_array( $wordLastVowel, $frontVowels ) ) {
106 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
109 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
110 if ( in_array( $wordLastVowel, $frontVowels ) ) {
112 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
115 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
116 if ( in_array( $wordLastVowel, $frontVowels ) ) {
118 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
125 case "accusative": # tabıs
126 if ( in_array( $wordEnding, $Consonants ) ) {
127 if ( in_array( $wordLastVowel, $frontVowels ) ) {
129 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
132 } elseif ( in_array( $wordEnding, $allVowels ) ) {
133 if ( in_array( $wordLastVowel, $frontVowels ) ) {
135 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
138 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
139 if ( in_array( $wordLastVowel, $frontVowels ) ) {
141 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
148 case "possessive accusative": # täweldık + tabıs
149 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
150 if ( in_array( $wordLastVowel, $frontVowels ) ) {
152 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
155 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
161 case "locative": # jatıs
162 if ( in_array( $wordEnding, $Consonants ) ) {
163 if ( in_array( $wordLastVowel, $frontVowels ) ) {
165 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
168 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
169 if ( in_array( $wordLastVowel, $frontVowels ) ) {
171 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
178 case "possessive locative": # täweldık + jatıs
179 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
180 if ( in_array( $wordLastVowel, $frontVowels ) ) {
182 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
185 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
186 if ( in_array( $wordLastVowel, $frontVowels ) ) {
188 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
195 case "ablative": # şığıs
196 if ( in_array( $wordEnding, $Consonants ) ) {
197 if ( in_array( $wordLastVowel, $frontVowels ) ) {
199 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
202 } elseif ( in_array( $wordEnding, $allVowels )
203 || in_array( $wordEnding, $Sonants )
204 || in_array( $wordEnding, $Sibilants )
206 if ( in_array( $wordLastVowel, $frontVowels ) ) {
208 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
211 } elseif ( in_array( $wordEnding, $Nasals ) ) {
212 if ( in_array( $wordLastVowel, $frontVowels ) ) {
214 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
221 case "possessive ablative": # täweldık + şığıs
222 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
223 if ( in_array( $wordLastVowel, $frontVowels ) ) {
225 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
228 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
229 if ( in_array( $wordLastVowel, $frontVowels ) ) {
231 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
238 case "comitative": # kömektes
239 if ( in_array( $wordEnding, $Consonants ) ) {
241 } elseif ( in_array( $wordEnding, $allVowels )
242 || in_array( $wordEnding, $Nasals )
243 || in_array( $wordEnding, $Sonants )
246 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
251 case "possessive comitative": # täweldık + kömektes
252 if ( in_array( $wordEnding, $Consonants ) ) {
254 } elseif ( in_array( $wordEnding, $allVowels )
255 || in_array( $wordEnding, $Nasals )
256 || in_array( $wordEnding, $Sonants )
259 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
264 default: # dc0 #nominative #ataw