9 class LanguageKk_cyrl
extends Language
{
11 # Convert from the nominative form of a noun to some other case
12 # Invoked with {{GRAMMAR:case|word}}
14 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
17 function convertGrammarKk_cyrl( $word, $case ) {
18 global $wgGrammarForms;
19 if ( isset( $wgGrammarForms['kk-kz'][$case][$word] ) ) {
20 return $wgGrammarForms['kk-kz'][$case][$word];
22 if ( isset( $wgGrammarForms['kk-cyrl'][$case][$word] ) ) {
23 return $wgGrammarForms['kk-cyrl'][$case][$word];
25 // Set up some constants...
26 // Vowels in last syllable
27 $frontVowels = array( "е", "ө", "ү", "і", "ә", "э", "я", "ё", "и" );
28 $backVowels = array( "а", "о", "ұ", "ы" );
29 $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" );
31 $Nasals = array( "м", "н", "ң" );
32 $Sonants = array( "и", "й", "л", "р", "у", "ю");
33 $Consonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" );
34 $Sibilants = array( "ж", "з" );
35 $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з");
38 $firstPerson = array( "м", "ң" ); // 1st singular, 2nd unformal
39 $secondPerson = array( "з" ); // 1st plural, 2nd formal
40 $thirdPerson = array( "ы", "і" ); // 3rd
42 $lastLetter = self
::lastLetter( $word, $allVowels );
43 $wordEnding =& $lastLetter[0];
44 $wordLastVowel =& $lastLetter[1];
46 // Now convert the word
49 case "genitive": #ilik
50 if ( in_array( $wordEnding, $Consonants ) ) {
51 if ( in_array( $wordLastVowel, $frontVowels ) ) {
52 $word = $word . "тің";
53 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
54 $word = $word . "тың";
56 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
57 if ( in_array( $wordLastVowel, $frontVowels ) ) {
58 $word = $word . "нің";
59 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
60 $word = $word . "ның";
62 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants )) {
63 if ( in_array( $wordLastVowel, $frontVowels ) ) {
64 $word = $word . "дің";
65 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
66 $word = $word . "дың";
72 if ( in_array( $wordEnding, $Consonants ) ) {
73 if ( in_array( $wordLastVowel, $frontVowels ) ) {
75 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
78 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
79 if ( in_array( $wordLastVowel, $frontVowels ) ) {
81 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
87 case "possessive dative": #täweldık + barıs
88 if ( in_array( $wordEnding, $firstPerson ) ) {
89 if ( in_array( $wordLastVowel, $frontVowels ) ) {
91 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
94 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
95 if ( in_array( $wordLastVowel, $frontVowels ) ) {
97 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
100 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
101 if ( in_array( $wordLastVowel, $frontVowels ) ) {
102 $word = $word . "не";
103 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
104 $word = $word . "на";
109 case "accusative": #tabıs
110 if ( in_array( $wordEnding, $Consonants ) ) {
111 if ( in_array( $wordLastVowel, $frontVowels ) ) {
112 $word = $word . "ті";
113 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
114 $word = $word . "ты";
116 } elseif ( in_array( $wordEnding, $allVowels ) ) {
117 if ( in_array($wordLastVowel, $frontVowels ) ) {
118 $word = $word . "ні";
119 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
120 $word = $word . "ны";
122 } elseif ( in_array( $wordEnding, $Sonorants) ) {
123 if ( in_array( $wordLastVowel, $frontVowels) ) {
124 $word = $word . "ді";
125 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
126 $word = $word . "ды";
131 case "possessive accusative": #täweldık + tabıs
132 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
133 if ( in_array( $wordLastVowel, $frontVowels ) ) {
134 $word = $word . "ді";
135 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
136 $word = $word . "ды";
138 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
143 case "locative": #jatıs
144 if ( in_array( $wordEnding, $Consonants ) ) {
145 if ( in_array( $wordLastVowel, $frontVowels ) ) {
146 $word = $word . "те";
147 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
148 $word = $word . "та";
150 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
151 if ( in_array( $wordLastVowel, $frontVowels) ) {
152 $word = $word . "де";
153 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
154 $word = $word . "да";
159 case "possessive locative": #täweldık + jatıs
160 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
161 if ( in_array( $wordLastVowel, $frontVowels ) ) {
162 $word = $word . "де";
163 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
164 $word = $word . "да";
166 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
167 if ( in_array( $wordLastVowel, $frontVowels) ) {
168 $word = $word . "нде";
169 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
170 $word = $word . "нда";
175 case "ablative": #şığıs
176 if ( in_array( $wordEnding, $Consonants ) ) {
177 if ( in_array( $wordLastVowel, $frontVowels ) ) {
178 $word = $word . "тен";
179 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
180 $word = $word . "тан";
182 } elseif ( in_array($wordEnding, $allVowels ) ||
in_array($wordEnding, $Sonants ) ||
in_array($wordEnding, $Sibilants ) ) {
183 if ( in_array( $wordLastVowel, $frontVowels ) ) {
184 $word = $word . "ден";
185 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
186 $word = $word . "дан";
188 } elseif ( in_array($wordEnding, $Nasals ) ) {
189 if ( in_array( $wordLastVowel, $frontVowels ) ) {
190 $word = $word . "нен";
191 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
192 $word = $word . "нан";
197 case "possessive ablative": #täweldık + şığıs
198 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
199 if ( in_array( $wordLastVowel, $frontVowels ) ) {
200 $word = $word . "нен";
201 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
202 $word = $word . "нан";
204 } elseif ( in_array($wordEnding, $secondPerson ) ) {
205 if ( in_array( $wordLastVowel, $frontVowels ) ) {
206 $word = $word . "ден";
207 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
208 $word = $word . "дан";
213 case "comitative": #kömektes
214 if ( in_array( $wordEnding, $Consonants ) ) {
215 $word = $word . "пен";
216 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
217 $word = $word . "мен";
218 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
219 $word = $word . "бен";
223 case "possessive comitative": #täweldık + kömektes
224 if ( in_array( $wordEnding, $Consonants ) ) {
225 $word = $word . "пенен";
226 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
227 $word = $word . "менен";
228 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
229 $word = $word . "бенен";
232 default: #dc0 #nominative #ataw
237 function convertGrammarKk_latn( $word, $case ) {
238 global $wgGrammarForms;
239 if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
240 return $wgGrammarForms['kk-tr'][$case][$word];
242 if ( isset( $wgGrammarForms['kk-latn'][$case][$word] ) ) {
243 return $wgGrammarForms['kk-latn'][$case][$word];
245 // Set up some constants...
246 // Vowels in last syllable
247 $frontVowels = array( "e", "ö", "ü", "i", "ä", "é" );
248 $backVowels = array( "a", "o", "u", "ı" );
249 $allVowels = array( "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" );
251 $Nasals = array( "m", "n", "ñ" );
252 $Sonants = array( "ï", "y", "ý", "l", "r", "w");
253 $Consonants = array( "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" );
254 $Sibilants = array( "j", "z" );
255 $Sonorants = array( "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z");
258 $firstPerson = array( "m", "ñ" ); // 1st singular, 2nd unformal
259 $secondPerson = array( "z" ); // 1st plural, 2nd formal
260 $thirdPerson = array( "ı", "i" ); // 3rd
262 $lastLetter = self
::lastLetter( $word, $allVowels );
263 $wordEnding =& $lastLetter[0];
264 $wordLastVowel =& $lastLetter[1];
266 // Now convert the word
269 case "genitive": #ilik
270 if ( in_array( $wordEnding, $Consonants ) ) {
271 if ( in_array( $wordLastVowel, $frontVowels ) ) {
272 $word = $word . "tiñ";
273 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
274 $word = $word . "tıñ";
276 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
277 if ( in_array( $wordLastVowel, $frontVowels ) ) {
278 $word = $word . "niñ";
279 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
280 $word = $word . "nıñ";
282 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants )) {
283 if ( in_array( $wordLastVowel, $frontVowels ) ) {
284 $word = $word . "diñ";
285 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
286 $word = $word . "dıñ";
291 case "dative": #barıs
292 if ( in_array( $wordEnding, $Consonants ) ) {
293 if ( in_array( $wordLastVowel, $frontVowels ) ) {
294 $word = $word . "ke";
295 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
296 $word = $word . "qa";
298 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
299 if ( in_array( $wordLastVowel, $frontVowels ) ) {
300 $word = $word . "ge";
301 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
302 $word = $word . "ğa";
307 case "possessive dative": #täweldık + barıs
308 if ( in_array( $wordEnding, $firstPerson ) ) {
309 if ( in_array( $wordLastVowel, $frontVowels ) ) {
311 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
314 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
315 if ( in_array( $wordLastVowel, $frontVowels ) ) {
316 $word = $word . "ge";
317 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
318 $word = $word . "ğa";
320 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
321 if ( in_array( $wordLastVowel, $frontVowels ) ) {
322 $word = $word . "ne";
323 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
324 $word = $word . "na";
329 case "accusative": #tabıs
330 if ( in_array( $wordEnding, $Consonants ) ) {
331 if ( in_array( $wordLastVowel, $frontVowels ) ) {
332 $word = $word . "ti";
333 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
334 $word = $word . "tı";
336 } elseif ( in_array( $wordEnding, $allVowels ) ) {
337 if ( in_array($wordLastVowel, $frontVowels ) ) {
338 $word = $word . "ni";
339 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
340 $word = $word . "nı";
342 } elseif ( in_array( $wordEnding, $Sonorants) ) {
343 if ( in_array( $wordLastVowel, $frontVowels) ) {
344 $word = $word . "di";
345 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
346 $word = $word . "dı";
351 case "possessive accusative": #täweldık + tabıs
352 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
353 if ( in_array( $wordLastVowel, $frontVowels ) ) {
354 $word = $word . "di";
355 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
356 $word = $word . "dı";
358 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
363 case "locative": #jatıs
364 if ( in_array( $wordEnding, $Consonants ) ) {
365 if ( in_array( $wordLastVowel, $frontVowels ) ) {
366 $word = $word . "te";
367 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
368 $word = $word . "ta";
370 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
371 if ( in_array( $wordLastVowel, $frontVowels) ) {
372 $word = $word . "de";
373 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
374 $word = $word . "da";
379 case "possessive locative": #täweldık + jatıs
380 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
381 if ( in_array( $wordLastVowel, $frontVowels ) ) {
382 $word = $word . "de";
383 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
384 $word = $word . "da";
386 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
387 if ( in_array( $wordLastVowel, $frontVowels) ) {
388 $word = $word . "nde";
389 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
390 $word = $word . "nda";
395 case "ablative": #şığıs
396 if ( in_array( $wordEnding, $Consonants ) ) {
397 if ( in_array( $wordLastVowel, $frontVowels ) ) {
398 $word = $word . "ten";
399 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
400 $word = $word . "tan";
402 } elseif ( in_array($wordEnding, $allVowels ) ||
in_array($wordEnding, $Sonants ) ||
in_array($wordEnding, $Sibilants ) ) {
403 if ( in_array( $wordLastVowel, $frontVowels ) ) {
404 $word = $word . "den";
405 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
406 $word = $word . "dan";
408 } elseif ( in_array($wordEnding, $Nasals ) ) {
409 if ( in_array( $wordLastVowel, $frontVowels ) ) {
410 $word = $word . "nen";
411 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
412 $word = $word . "nan";
417 case "possessive ablative": #täweldık + şığıs
418 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
419 if ( in_array( $wordLastVowel, $frontVowels ) ) {
420 $word = $word . "nen";
421 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
422 $word = $word . "nan";
424 } elseif ( in_array($wordEnding, $secondPerson ) ) {
425 if ( in_array( $wordLastVowel, $frontVowels ) ) {
426 $word = $word . "den";
427 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
428 $word = $word . "dan";
433 case "comitative": #kömektes
434 if ( in_array( $wordEnding, $Consonants ) ) {
435 $word = $word . "pen";
436 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
437 $word = $word . "men";
438 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
439 $word = $word . "ben";
443 case "possessive comitative": #täweldık + kömektes
444 if ( in_array( $wordEnding, $Consonants ) ) {
445 $word = $word . "penen";
446 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
447 $word = $word . "menen";
448 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
449 $word = $word . "benen";
452 default: #dc0 #nominative #ataw
457 function convertGrammarKk_arab( $word, $case ) {
458 global $wgGrammarForms;
459 if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
460 return $wgGrammarForms['kk-cn'][$case][$word];
462 if ( isset( $wgGrammarForms['kk-arab'][$case][$word] ) ) {
463 return $wgGrammarForms['kk-arab'][$case][$word];
465 // Set up some constants...
466 // Vowels in last syllable
467 $frontVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" );
468 $backVowels = array( "ا", "و", "ۇ", "ى" );
469 $allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
471 $Nasals = array( "م", "ن", "ڭ" );
472 $Sonants = array( "ي", "ي", "ل", "ر", "ۋ");
473 $Consonants = array( "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" );
474 $Sibilants = array( "ج", "ز" );
475 $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز");
478 $firstPerson = array( "م", "ڭ" ); // 1st singular, 2nd unformal
479 $secondPerson = array( "ز" ); // 1st plural, 2nd formal
480 $thirdPerson = array( "ى", "ٸ" ); // 3rd
482 $lastLetter = self
::lastLetter( $word, $allVowels );
483 $wordEnding =& $lastLetter[0];
484 $wordLastVowel =& $lastLetter[1];
486 // Now convert the word
489 case "genitive": #ilik
490 if ( in_array( $wordEnding, $Consonants ) ) {
491 if ( in_array( $wordLastVowel, $frontVowels ) ) {
492 $word = $word . "تٸڭ";
493 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
494 $word = $word . "تىڭ";
496 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
497 if ( in_array( $wordLastVowel, $frontVowels ) ) {
498 $word = $word . "نٸڭ";
499 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
500 $word = $word . "نىڭ";
502 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants )) {
503 if ( in_array( $wordLastVowel, $frontVowels ) ) {
504 $word = $word . "دٸڭ";
505 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
506 $word = $word . "دىڭ";
511 case "dative": #barıs
512 if ( in_array( $wordEnding, $Consonants ) ) {
513 if ( in_array( $wordLastVowel, $frontVowels ) ) {
514 $word = $word . "كە";
515 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
516 $word = $word . "قا";
518 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
519 if ( in_array( $wordLastVowel, $frontVowels ) ) {
520 $word = $word . "گە";
521 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
522 $word = $word . "عا";
527 case "possessive dative": #täweldık + barıs
528 if ( in_array( $wordEnding, $firstPerson ) ) {
529 if ( in_array( $wordLastVowel, $frontVowels ) ) {
531 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
534 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
535 if ( in_array( $wordLastVowel, $frontVowels ) ) {
536 $word = $word . "گە";
537 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
538 $word = $word . "عا";
540 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
541 if ( in_array( $wordLastVowel, $frontVowels ) ) {
542 $word = $word . "نە";
543 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
544 $word = $word . "نا";
549 case "accusative": #tabıs
550 if ( in_array( $wordEnding, $Consonants ) ) {
551 if ( in_array( $wordLastVowel, $frontVowels ) ) {
552 $word = $word . "تٸ";
553 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
554 $word = $word . "تى";
556 } elseif ( in_array( $wordEnding, $allVowels ) ) {
557 if ( in_array($wordLastVowel, $frontVowels ) ) {
558 $word = $word . "نٸ";
559 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
560 $word = $word . "نى";
562 } elseif ( in_array( $wordEnding, $Sonorants) ) {
563 if ( in_array( $wordLastVowel, $frontVowels) ) {
564 $word = $word . "دٸ";
565 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
566 $word = $word . "دى";
571 case "possessive accusative": #täweldık + tabıs
572 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
573 if ( in_array( $wordLastVowel, $frontVowels ) ) {
574 $word = $word . "دٸ";
575 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
576 $word = $word . "دى";
578 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
583 case "locative": #jatıs
584 if ( in_array( $wordEnding, $Consonants ) ) {
585 if ( in_array( $wordLastVowel, $frontVowels ) ) {
586 $word = $word . "تە";
587 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
588 $word = $word . "تا";
590 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
591 if ( in_array( $wordLastVowel, $frontVowels) ) {
592 $word = $word . "دە";
593 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
594 $word = $word . "دا";
599 case "possessive locative": #täweldık + jatıs
600 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
601 if ( in_array( $wordLastVowel, $frontVowels ) ) {
602 $word = $word . "دە";
603 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
604 $word = $word . "دا";
606 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
607 if ( in_array( $wordLastVowel, $frontVowels) ) {
608 $word = $word . "ندە";
609 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
610 $word = $word . "ندا";
615 case "ablative": #şığıs
616 if ( in_array( $wordEnding, $Consonants ) ) {
617 if ( in_array( $wordLastVowel, $frontVowels ) ) {
618 $word = $word . "تەن";
619 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
620 $word = $word . "تان";
622 } elseif ( in_array($wordEnding, $allVowels ) ||
in_array($wordEnding, $Sonants ) ||
in_array($wordEnding, $Sibilants ) ) {
623 if ( in_array( $wordLastVowel, $frontVowels ) ) {
624 $word = $word . "دەن";
625 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
626 $word = $word . "دان";
628 } elseif ( in_array($wordEnding, $Nasals ) ) {
629 if ( in_array( $wordLastVowel, $frontVowels ) ) {
630 $word = $word . "نەن";
631 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
632 $word = $word . "نان";
637 case "possessive ablative": #täweldık + şığıs
638 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
639 if ( in_array( $wordLastVowel, $frontVowels ) ) {
640 $word = $word . "نەن";
641 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
642 $word = $word . "نان";
644 } elseif ( in_array($wordEnding, $secondPerson ) ) {
645 if ( in_array( $wordLastVowel, $frontVowels ) ) {
646 $word = $word . "دەن";
647 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
648 $word = $word . "دان";
653 case "comitative": #kömektes
654 if ( in_array( $wordEnding, $Consonants ) ) {
655 $word = $word . "پەن";
656 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
657 $word = $word . "مەن";
658 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
659 $word = $word . "بەن";
663 case "possessive comitative": #täweldık + kömektes
664 if ( in_array( $wordEnding, $Consonants ) ) {
665 $word = $word . "پەنەن";
666 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
667 $word = $word . "مەنەن";
668 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
669 $word = $word . "بەنەن";
672 default: #dc0 #nominative #ataw
677 function lastLetter( $word, $allVowels ) {
678 $lastLetter = array();
681 // Put the word in a form we can play with since we're using UTF-8
682 $ar = preg_split('//u', parent
::lc($word), -1, PREG_SPLIT_NO_EMPTY
);
684 // Here's an array with the order of the letters in the word reversed
685 // so we can find a match quicker *shrug*
686 $wordReversed = array_reverse( $ar );
688 // Here's the last letter in the word
689 $lastLetter[0] = $ar[count( $ar ) - 1];
691 // Find the last vowel in the word
692 $lastLetter[1] = NULL;
693 foreach ( $wordReversed as $xvalue ) {
694 foreach ( $allVowels as $yvalue ) {
695 if ( strcmp( $xvalue, $yvalue ) == 0 ) {
696 $lastLetter[1] = $xvalue;
702 if ( $lastLetter[1] !== NULL ) {
713 * Avoid grouping whole numbers between 0 to 9999
715 function commafy( $_ ) {
716 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
717 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );