32 # Convert from the nominative form of a noun to some other case
33 # Invoked with {{GRAMMAR:case|word}}
44 if ( isset( $wgGrammarForms[
'kk-kz'][$case][$word] ) ) {
45 return $wgGrammarForms[
'kk-kz'][$case][$word];
47 if ( isset( $wgGrammarForms[
'kk-cyrl'][$case][$word] ) ) {
48 return $wgGrammarForms[
'kk-cyrl'][$case][$word];
52 $frontVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"я",
"ё",
"и" ];
53 $backVowels = [
"а",
"о",
"ұ",
"ы" ];
54 $allVowels = [
"е",
"ө",
"ү",
"і",
"ә",
"э",
"а",
"о",
"ұ",
"ы",
"я",
"ё",
"и" ];
56 $Nasals = [
"м",
"н",
"ң" ];
57 $Sonants = [
"и",
"й",
"л",
"р",
"у",
"ю" ];
58 $Consonants = [
"п",
"ф",
"к",
"қ",
"т",
"ш",
"с",
"х",
"ц",
"ч",
"щ",
"б",
"в",
"г",
"д" ];
59 $Sibilants = [
"ж",
"з" ];
60 $Sonorants = [
"и",
"й",
"л",
"р",
"у",
"ю",
"м",
"н",
"ң",
"ж",
"з" ];
63 $firstPerson = [
"м",
"ң" ];
64 $secondPerson = [
"з" ];
65 $thirdPerson = [
"ы",
"і" ];
67 $lastLetter = $this->
lastLetter( $word, $allVowels );
68 $wordEnding =& $lastLetter[0];
69 $wordLastVowel =& $lastLetter[1];
74 case "genitive": # ilik
75 if ( in_array( $wordEnding, $Consonants ) ) {
76 if ( in_array( $wordLastVowel, $frontVowels ) ) {
77 $word = $word .
"тің";
78 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
79 $word = $word .
"тың";
81 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
82 if ( in_array( $wordLastVowel, $frontVowels ) ) {
83 $word = $word .
"нің";
84 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
85 $word = $word .
"ның";
87 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
88 if ( in_array( $wordLastVowel, $frontVowels ) ) {
89 $word = $word .
"дің";
90 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
91 $word = $word .
"дың";
96 case "dative": # barıs
97 if ( in_array( $wordEnding, $Consonants ) ) {
98 if ( in_array( $wordLastVowel, $frontVowels ) ) {
100 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
101 $word = $word .
"қа";
103 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
104 if ( in_array( $wordLastVowel, $frontVowels ) ) {
105 $word = $word .
"ге";
106 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
107 $word = $word .
"ға";
112 case "possessive dative": # täweldık + barıs
113 if ( in_array( $wordEnding, $firstPerson ) ) {
114 if ( in_array( $wordLastVowel, $frontVowels ) ) {
116 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
119 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
120 if ( in_array( $wordLastVowel, $frontVowels ) ) {
121 $word = $word .
"ге";
122 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
123 $word = $word .
"ға";
125 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
126 if ( in_array( $wordLastVowel, $frontVowels ) ) {
127 $word = $word .
"не";
128 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
129 $word = $word .
"на";
134 case "accusative": # tabıs
135 if ( in_array( $wordEnding, $Consonants ) ) {
136 if ( in_array( $wordLastVowel, $frontVowels ) ) {
137 $word = $word .
"ті";
138 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
139 $word = $word .
"ты";
141 } elseif ( in_array( $wordEnding, $allVowels ) ) {
142 if ( in_array( $wordLastVowel, $frontVowels ) ) {
143 $word = $word .
"ні";
144 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
145 $word = $word .
"ны";
147 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
148 if ( in_array( $wordLastVowel, $frontVowels ) ) {
149 $word = $word .
"ді";
150 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
151 $word = $word .
"ды";
156 case "possessive accusative": # täweldık + tabıs
157 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
158 if ( in_array( $wordLastVowel, $frontVowels ) ) {
159 $word = $word .
"ді";
160 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
161 $word = $word .
"ды";
163 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
168 case "locative": # jatıs
169 if ( in_array( $wordEnding, $Consonants ) ) {
170 if ( in_array( $wordLastVowel, $frontVowels ) ) {
171 $word = $word .
"те";
172 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
173 $word = $word .
"та";
175 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
176 if ( in_array( $wordLastVowel, $frontVowels ) ) {
177 $word = $word .
"де";
178 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
179 $word = $word .
"да";
184 case "possessive locative": # täweldık + jatıs
185 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
186 if ( in_array( $wordLastVowel, $frontVowels ) ) {
187 $word = $word .
"де";
188 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
189 $word = $word .
"да";
191 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
192 if ( in_array( $wordLastVowel, $frontVowels ) ) {
193 $word = $word .
"нде";
194 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
195 $word = $word .
"нда";
200 case "ablative": # şığıs
201 if ( in_array( $wordEnding, $Consonants ) ) {
202 if ( in_array( $wordLastVowel, $frontVowels ) ) {
203 $word = $word .
"тен";
204 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
205 $word = $word .
"тан";
207 } elseif ( in_array( $wordEnding, $allVowels )
208 || in_array( $wordEnding, $Sonants )
209 || in_array( $wordEnding, $Sibilants )
211 if ( in_array( $wordLastVowel, $frontVowels ) ) {
212 $word = $word .
"ден";
213 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
214 $word = $word .
"дан";
216 } elseif ( in_array( $wordEnding, $Nasals ) ) {
217 if ( in_array( $wordLastVowel, $frontVowels ) ) {
218 $word = $word .
"нен";
219 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
220 $word = $word .
"нан";
225 case "possessive ablative": # täweldık + şığıs
226 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
227 if ( in_array( $wordLastVowel, $frontVowels ) ) {
228 $word = $word .
"нен";
229 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
230 $word = $word .
"нан";
232 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
233 if ( in_array( $wordLastVowel, $frontVowels ) ) {
234 $word = $word .
"ден";
235 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
236 $word = $word .
"дан";
241 case "comitative": # kömektes
242 if ( in_array( $wordEnding, $Consonants ) ) {
243 $word = $word .
"пен";
244 } elseif ( in_array( $wordEnding, $allVowels )
245 || in_array( $wordEnding, $Nasals )
246 || in_array( $wordEnding, $Sonants )
248 $word = $word .
"мен";
249 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
250 $word = $word .
"бен";
254 case "possessive comitative": # täweldık + kömektes
255 if ( in_array( $wordEnding, $Consonants ) ) {
256 $word = $word .
"пенен";
257 } elseif ( in_array( $wordEnding, $allVowels )
258 || in_array( $wordEnding, $Nasals )
259 || in_array( $wordEnding, $Sonants )
261 $word = $word .
"менен";
262 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
263 $word = $word .
"бенен";
266 default: # dc0 #nominative #ataw
278 if ( isset( $wgGrammarForms[
'kk-tr'][$case][$word] ) ) {
279 return $wgGrammarForms[
'kk-tr'][$case][$word];
281 if ( isset( $wgGrammarForms[
'kk-latn'][$case][$word] ) ) {
282 return $wgGrammarForms[
'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 $lastLetter = $this->
lastLetter( $word, $allVowels );
302 $wordEnding =& $lastLetter[0];
303 $wordLastVowel =& $lastLetter[1];
308 case "genitive": # ilik
309 if ( in_array( $wordEnding, $Consonants ) ) {
310 if ( in_array( $wordLastVowel, $frontVowels ) ) {
311 $word = $word .
"tiñ";
312 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
313 $word = $word .
"tıñ";
315 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
316 if ( in_array( $wordLastVowel, $frontVowels ) ) {
317 $word = $word .
"niñ";
318 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
319 $word = $word .
"nıñ";
321 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
322 if ( in_array( $wordLastVowel, $frontVowels ) ) {
323 $word = $word .
"diñ";
324 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
325 $word = $word .
"dıñ";
330 case "dative": # barıs
331 if ( in_array( $wordEnding, $Consonants ) ) {
332 if ( in_array( $wordLastVowel, $frontVowels ) ) {
333 $word = $word .
"ke";
334 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
335 $word = $word .
"qa";
337 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
338 if ( in_array( $wordLastVowel, $frontVowels ) ) {
339 $word = $word .
"ge";
340 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
341 $word = $word .
"ğa";
346 case "possessive dative": # täweldık + barıs
347 if ( in_array( $wordEnding, $firstPerson ) ) {
348 if ( in_array( $wordLastVowel, $frontVowels ) ) {
350 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
353 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
354 if ( in_array( $wordLastVowel, $frontVowels ) ) {
355 $word = $word .
"ge";
356 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
357 $word = $word .
"ğa";
359 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
360 if ( in_array( $wordLastVowel, $frontVowels ) ) {
361 $word = $word .
"ne";
362 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
363 $word = $word .
"na";
368 case "accusative": # tabıs
369 if ( in_array( $wordEnding, $Consonants ) ) {
370 if ( in_array( $wordLastVowel, $frontVowels ) ) {
371 $word = $word .
"ti";
372 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
373 $word = $word .
"tı";
375 } elseif ( in_array( $wordEnding, $allVowels ) ) {
376 if ( in_array( $wordLastVowel, $frontVowels ) ) {
377 $word = $word .
"ni";
378 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
379 $word = $word .
"nı";
381 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
382 if ( in_array( $wordLastVowel, $frontVowels ) ) {
383 $word = $word .
"di";
384 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
385 $word = $word .
"dı";
390 case "possessive accusative": # täweldık + tabıs
391 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
392 if ( in_array( $wordLastVowel, $frontVowels ) ) {
393 $word = $word .
"di";
394 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
395 $word = $word .
"dı";
397 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
402 case "locative": # jatıs
403 if ( in_array( $wordEnding, $Consonants ) ) {
404 if ( in_array( $wordLastVowel, $frontVowels ) ) {
405 $word = $word .
"te";
406 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
407 $word = $word .
"ta";
409 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
410 if ( in_array( $wordLastVowel, $frontVowels ) ) {
411 $word = $word .
"de";
412 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
413 $word = $word .
"da";
418 case "possessive locative": # täweldık + jatıs
419 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
420 if ( in_array( $wordLastVowel, $frontVowels ) ) {
421 $word = $word .
"de";
422 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
423 $word = $word .
"da";
425 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
426 if ( in_array( $wordLastVowel, $frontVowels ) ) {
427 $word = $word .
"nde";
428 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
429 $word = $word .
"nda";
434 case "ablative": # şığıs
435 if ( in_array( $wordEnding, $Consonants ) ) {
436 if ( in_array( $wordLastVowel, $frontVowels ) ) {
437 $word = $word .
"ten";
438 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
439 $word = $word .
"tan";
441 } elseif ( in_array( $wordEnding, $allVowels )
442 || in_array( $wordEnding, $Sonants )
443 || in_array( $wordEnding, $Sibilants )
445 if ( in_array( $wordLastVowel, $frontVowels ) ) {
446 $word = $word .
"den";
447 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
448 $word = $word .
"dan";
450 } elseif ( in_array( $wordEnding, $Nasals ) ) {
451 if ( in_array( $wordLastVowel, $frontVowels ) ) {
452 $word = $word .
"nen";
453 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
454 $word = $word .
"nan";
459 case "possessive ablative": # täweldık + şığıs
460 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
461 if ( in_array( $wordLastVowel, $frontVowels ) ) {
462 $word = $word .
"nen";
463 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
464 $word = $word .
"nan";
466 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
467 if ( in_array( $wordLastVowel, $frontVowels ) ) {
468 $word = $word .
"den";
469 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
470 $word = $word .
"dan";
475 case "comitative": # kömektes
476 if ( in_array( $wordEnding, $Consonants ) ) {
477 $word = $word .
"pen";
478 } elseif ( in_array( $wordEnding, $allVowels )
479 || in_array( $wordEnding, $Nasals )
480 || in_array( $wordEnding, $Sonants )
482 $word = $word .
"men";
483 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
484 $word = $word .
"ben";
488 case "possessive comitative": # täweldık + kömektes
489 if ( in_array( $wordEnding, $Consonants ) ) {
490 $word = $word .
"penen";
491 } elseif ( in_array( $wordEnding, $allVowels )
492 || in_array( $wordEnding, $Nasals )
493 || in_array( $wordEnding, $Sonants )
495 $word = $word .
"menen";
496 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
497 $word = $word .
"benen";
500 default: # dc0 #nominative #ataw
512 if ( isset( $wgGrammarForms[
'kk-cn'][$case][$word] ) ) {
513 return $wgGrammarForms[
'kk-cn'][$case][$word];
515 if ( isset( $wgGrammarForms[
'kk-arab'][$case][$word] ) ) {
516 return $wgGrammarForms[
'kk-arab'][$case][$word];
520 $frontVowels = [
"ە",
"ٶ",
"ٷ",
"ٸ",
"ٵ",
"ە" ];
521 $backVowels = [
"ا",
"و",
"ۇ",
"ى" ];
522 $allVowels = [
"ە",
"ٶ",
"ٷ",
"ٸ",
"ٵ",
"ە",
"ا",
"و",
"ۇ",
"ى" ];
524 $Nasals = [
"م",
"ن",
"ڭ" ];
525 $Sonants = [
"ي",
"ي",
"ل",
"ر",
"ۋ" ];
526 $Consonants = [
"پ",
"ف",
"ك",
"ق",
"ت",
"ش",
"س",
"ح",
"تس",
"چ",
"ب",
"ۆ",
"گ",
"د" ];
527 $Sibilants = [
"ج",
"ز" ];
528 $Sonorants = [
"ي",
"ي",
"ل",
"ر",
"ۋ",
"م",
"ن",
"ڭ",
"ج",
"ز" ];
531 $firstPerson = [
"م",
"ڭ" ];
532 $secondPerson = [
"ز" ];
533 $thirdPerson = [
"ى",
"ٸ" ];
535 $lastLetter = $this->
lastLetter( $word, $allVowels );
536 $wordEnding = $lastLetter[0];
537 $wordLastVowel = $lastLetter[1];
542 case "genitive": # ilik
543 if ( in_array( $wordEnding, $Consonants ) ) {
544 if ( in_array( $wordLastVowel, $frontVowels ) ) {
545 $word = $word .
"تٸڭ";
546 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
547 $word = $word .
"تىڭ";
549 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
550 if ( in_array( $wordLastVowel, $frontVowels ) ) {
551 $word = $word .
"نٸڭ";
552 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
553 $word = $word .
"نىڭ";
555 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants ) ) {
556 if ( in_array( $wordLastVowel, $frontVowels ) ) {
557 $word = $word .
"دٸڭ";
558 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
559 $word = $word .
"دىڭ";
564 case "dative": # barıs
565 if ( in_array( $wordEnding, $Consonants ) ) {
566 if ( in_array( $wordLastVowel, $frontVowels ) ) {
567 $word = $word .
"كە";
568 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
569 $word = $word .
"قا";
571 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
572 if ( in_array( $wordLastVowel, $frontVowels ) ) {
573 $word = $word .
"گە";
574 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
575 $word = $word .
"عا";
580 case "possessive dative": # täweldık + barıs
581 if ( in_array( $wordEnding, $firstPerson ) ) {
582 if ( in_array( $wordLastVowel, $frontVowels ) ) {
584 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
587 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
588 if ( in_array( $wordLastVowel, $frontVowels ) ) {
589 $word = $word .
"گە";
590 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
591 $word = $word .
"عا";
593 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
594 if ( in_array( $wordLastVowel, $frontVowels ) ) {
595 $word = $word .
"نە";
596 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
597 $word = $word .
"نا";
602 case "accusative": # tabıs
603 if ( in_array( $wordEnding, $Consonants ) ) {
604 if ( in_array( $wordLastVowel, $frontVowels ) ) {
605 $word = $word .
"تٸ";
606 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
607 $word = $word .
"تى";
609 } elseif ( in_array( $wordEnding, $allVowels ) ) {
610 if ( in_array( $wordLastVowel, $frontVowels ) ) {
611 $word = $word .
"نٸ";
612 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
613 $word = $word .
"نى";
615 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
616 if ( in_array( $wordLastVowel, $frontVowels ) ) {
617 $word = $word .
"دٸ";
618 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
619 $word = $word .
"دى";
624 case "possessive accusative": # täweldık + tabıs
625 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
626 if ( in_array( $wordLastVowel, $frontVowels ) ) {
627 $word = $word .
"دٸ";
628 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
629 $word = $word .
"دى";
631 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
636 case "locative": # jatıs
637 if ( in_array( $wordEnding, $Consonants ) ) {
638 if ( in_array( $wordLastVowel, $frontVowels ) ) {
639 $word = $word .
"تە";
640 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
641 $word = $word .
"تا";
643 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
644 if ( in_array( $wordLastVowel, $frontVowels ) ) {
645 $word = $word .
"دە";
646 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
647 $word = $word .
"دا";
652 case "possessive locative": # täweldık + jatıs
653 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
654 if ( in_array( $wordLastVowel, $frontVowels ) ) {
655 $word = $word .
"دە";
656 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
657 $word = $word .
"دا";
659 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
660 if ( in_array( $wordLastVowel, $frontVowels ) ) {
661 $word = $word .
"ندە";
662 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
663 $word = $word .
"ندا";
668 case "ablative": # şığıs
669 if ( in_array( $wordEnding, $Consonants ) ) {
670 if ( in_array( $wordLastVowel, $frontVowels ) ) {
671 $word = $word .
"تەن";
672 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
673 $word = $word .
"تان";
675 } elseif ( in_array( $wordEnding, $allVowels )
676 || in_array( $wordEnding, $Sonants )
677 || in_array( $wordEnding, $Sibilants )
679 if ( in_array( $wordLastVowel, $frontVowels ) ) {
680 $word = $word .
"دەن";
681 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
682 $word = $word .
"دان";
684 } elseif ( in_array( $wordEnding, $Nasals ) ) {
685 if ( in_array( $wordLastVowel, $frontVowels ) ) {
686 $word = $word .
"نەن";
687 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
688 $word = $word .
"نان";
693 case "possessive ablative": # täweldık + şığıs
694 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
695 if ( in_array( $wordLastVowel, $frontVowels ) ) {
696 $word = $word .
"نەن";
697 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
698 $word = $word .
"نان";
700 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
701 if ( in_array( $wordLastVowel, $frontVowels ) ) {
702 $word = $word .
"دەن";
703 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
704 $word = $word .
"دان";
709 case "comitative": # kömektes
710 if ( in_array( $wordEnding, $Consonants ) ) {
711 $word = $word .
"پەن";
712 } elseif ( in_array( $wordEnding, $allVowels )
713 || in_array( $wordEnding, $Nasals )
714 || in_array( $wordEnding, $Sonants )
716 $word = $word .
"مەن";
717 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
718 $word = $word .
"بەن";
722 case "possessive comitative": # täweldık + kömektes
723 if ( in_array( $wordEnding, $Consonants ) ) {
724 $word = $word .
"پەنەن";
725 } elseif ( in_array( $wordEnding, $allVowels )
726 || in_array( $wordEnding, $Nasals )
727 || in_array( $wordEnding, $Sonants )
729 $word = $word .
"مەنەن";
730 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
731 $word = $word .
"بەنەن";
734 default: # dc0 #nominative #ataw
748 $ar = preg_split(
'//u', parent::lc( $word ), -1, PREG_SPLIT_NO_EMPTY );
752 $wordReversed = array_reverse( $ar );
755 $lastLetter[0] = $ar[count( $ar ) - 1];
758 $lastLetter[1] = null;
759 foreach ( $wordReversed
as $xvalue ) {
760 foreach ( $allVowels
as $yvalue ) {
761 if ( strcmp( $xvalue, $yvalue ) == 0 ) {
762 $lastLetter[1] = $xvalue;
768 if ( $lastLetter[1] !== null ) {
786 if ( !preg_match(
'/^\d{1,4}$/', $_ ) ) {
787 return strrev( (
string)preg_replace(
'/(\d{3})(?=\d)(?!\d*\.)/',
'$1,', strrev( $_ ) ) );
convertGrammarKk_cyrl($word, $case)
Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms.
convertGrammarKk_latn($word, $case)
when a variable name is used in a it is silently declared as a new local masking the global
convertGrammarKk_arab($word, $case)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
$wgGrammarForms
Some languages need different word forms, usually for different cases.
lastLetter($word, $allVowels)
commafy($_)
Avoid grouping whole numbers between 0 to 9999.