7 class LanguageKk_cyrl
extends Language
{
9 # Convert from the nominative form of a noun to some other case
10 # Invoked with {{GRAMMAR:case|word}}
12 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
15 function convertGrammarKk_cyrl( $word, $case ) {
16 global $wgGrammarForms;
17 if ( isset( $wgGrammarForms['kk-kz'][$case][$word] ) ) {
18 return $wgGrammarForms['kk-kz'][$case][$word];
20 if ( isset( $wgGrammarForms['kk-cyrl'][$case][$word] ) ) {
21 return $wgGrammarForms['kk-cyrl'][$case][$word];
23 // Set up some constants...
24 // Vowels in last syllable
25 $frontVowels = array( "е", "ө", "ү", "і", "ә", "э", "я", "ё", "и" );
26 $backVowels = array( "а", "о", "ұ", "ы" );
27 $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" );
29 $Nasals = array( "м", "н", "ң" );
30 $Sonants = array( "и", "й", "л", "р", "у", "ю");
31 $Consonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" );
32 $Sibilants = array( "ж", "з" );
33 $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з");
36 $firstPerson = array( "м", "ң" ); // 1st singular, 2nd unformal
37 $secondPerson = array( "з" ); // 1st plural, 2nd formal
38 $thirdPerson = array( "ы", "і" ); // 3rd
40 $lastLetter = self
::lastLetter( $word, $allVowels );
41 $wordEnding =& $lastLetter[0];
42 $wordLastVowel =& $lastLetter[1];
44 // Now convert the word
47 case "genitive": #ilik
48 if ( in_array( $wordEnding, $Consonants ) ) {
49 if ( in_array( $wordLastVowel, $frontVowels ) ) {
50 $word = $word . "тің";
51 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
52 $word = $word . "тың";
54 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
55 if ( in_array( $wordLastVowel, $frontVowels ) ) {
56 $word = $word . "нің";
57 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
58 $word = $word . "ның";
60 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants )) {
61 if ( in_array( $wordLastVowel, $frontVowels ) ) {
62 $word = $word . "дің";
63 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
64 $word = $word . "дың";
70 if ( in_array( $wordEnding, $Consonants ) ) {
71 if ( in_array( $wordLastVowel, $frontVowels ) ) {
73 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
76 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
77 if ( in_array( $wordLastVowel, $frontVowels ) ) {
79 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
85 case "possessive dative": #täweldık + barıs
86 if ( in_array( $wordEnding, $firstPerson ) ) {
87 if ( in_array( $wordLastVowel, $frontVowels ) ) {
89 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
92 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
93 if ( in_array( $wordLastVowel, $frontVowels ) ) {
95 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
98 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
99 if ( in_array( $wordLastVowel, $frontVowels ) ) {
100 $word = $word . "не";
101 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
102 $word = $word . "на";
107 case "accusative": #tabıs
108 if ( in_array( $wordEnding, $Consonants ) ) {
109 if ( in_array( $wordLastVowel, $frontVowels ) ) {
110 $word = $word . "ті";
111 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
112 $word = $word . "ты";
114 } elseif ( in_array( $wordEnding, $allVowels ) ) {
115 if ( in_array($wordLastVowel, $frontVowels ) ) {
116 $word = $word . "ні";
117 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
118 $word = $word . "ны";
120 } elseif ( in_array( $wordEnding, $Sonorants) ) {
121 if ( in_array( $wordLastVowel, $frontVowels) ) {
122 $word = $word . "ді";
123 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
124 $word = $word . "ды";
129 case "possessive accusative": #täweldık + tabıs
130 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
131 if ( in_array( $wordLastVowel, $frontVowels ) ) {
132 $word = $word . "ді";
133 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
134 $word = $word . "ды";
136 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
141 case "locative": #jatıs
142 if ( in_array( $wordEnding, $Consonants ) ) {
143 if ( in_array( $wordLastVowel, $frontVowels ) ) {
144 $word = $word . "те";
145 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
146 $word = $word . "та";
148 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
149 if ( in_array( $wordLastVowel, $frontVowels) ) {
150 $word = $word . "де";
151 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
152 $word = $word . "да";
157 case "possessive locative": #täweldık + jatıs
158 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
159 if ( in_array( $wordLastVowel, $frontVowels ) ) {
160 $word = $word . "де";
161 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
162 $word = $word . "да";
164 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
165 if ( in_array( $wordLastVowel, $frontVowels) ) {
166 $word = $word . "нде";
167 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
168 $word = $word . "нда";
173 case "ablative": #şığıs
174 if ( in_array( $wordEnding, $Consonants ) ) {
175 if ( in_array( $wordLastVowel, $frontVowels ) ) {
176 $word = $word . "тен";
177 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
178 $word = $word . "тан";
180 } elseif ( in_array($wordEnding, $allVowels ) ||
in_array($wordEnding, $Sonants ) ||
in_array($wordEnding, $Sibilants ) ) {
181 if ( in_array( $wordLastVowel, $frontVowels ) ) {
182 $word = $word . "ден";
183 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
184 $word = $word . "дан";
186 } elseif ( in_array($wordEnding, $Nasals ) ) {
187 if ( in_array( $wordLastVowel, $frontVowels ) ) {
188 $word = $word . "нен";
189 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
190 $word = $word . "нан";
195 case "possessive ablative": #täweldık + şığıs
196 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
197 if ( in_array( $wordLastVowel, $frontVowels ) ) {
198 $word = $word . "нен";
199 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
200 $word = $word . "нан";
202 } elseif ( in_array($wordEnding, $secondPerson ) ) {
203 if ( in_array( $wordLastVowel, $frontVowels ) ) {
204 $word = $word . "ден";
205 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
206 $word = $word . "дан";
211 case "comitative": #kömektes
212 if ( in_array( $wordEnding, $Consonants ) ) {
213 $word = $word . "пен";
214 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
215 $word = $word . "мен";
216 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
217 $word = $word . "бен";
221 case "possessive comitative": #täweldık + kömektes
222 if ( in_array( $wordEnding, $Consonants ) ) {
223 $word = $word . "пенен";
224 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
225 $word = $word . "менен";
226 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
227 $word = $word . "бенен";
230 default: #dc0 #nominative #ataw
235 function convertGrammarKk_latn( $word, $case ) {
236 global $wgGrammarForms;
237 if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
238 return $wgGrammarForms['kk-tr'][$case][$word];
240 if ( isset( $wgGrammarForms['kk-latn'][$case][$word] ) ) {
241 return $wgGrammarForms['kk-latn'][$case][$word];
243 // Set up some constants...
244 // Vowels in last syllable
245 $frontVowels = array( "e", "ö", "ü", "i", "ä", "é" );
246 $backVowels = array( "a", "o", "u", "ı" );
247 $allVowels = array( "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" );
249 $Nasals = array( "m", "n", "ñ" );
250 $Sonants = array( "ï", "y", "ý", "l", "r", "w");
251 $Consonants = array( "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" );
252 $Sibilants = array( "j", "z" );
253 $Sonorants = array( "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z");
256 $firstPerson = array( "m", "ñ" ); // 1st singular, 2nd unformal
257 $secondPerson = array( "z" ); // 1st plural, 2nd formal
258 $thirdPerson = array( "ı", "i" ); // 3rd
260 $lastLetter = self
::lastLetter( $word, $allVowels );
261 $wordEnding =& $lastLetter[0];
262 $wordLastVowel =& $lastLetter[1];
264 // Now convert the word
267 case "genitive": #ilik
268 if ( in_array( $wordEnding, $Consonants ) ) {
269 if ( in_array( $wordLastVowel, $frontVowels ) ) {
270 $word = $word . "tiñ";
271 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
272 $word = $word . "tıñ";
274 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
275 if ( in_array( $wordLastVowel, $frontVowels ) ) {
276 $word = $word . "niñ";
277 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
278 $word = $word . "nıñ";
280 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants )) {
281 if ( in_array( $wordLastVowel, $frontVowels ) ) {
282 $word = $word . "diñ";
283 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
284 $word = $word . "dıñ";
289 case "dative": #barıs
290 if ( in_array( $wordEnding, $Consonants ) ) {
291 if ( in_array( $wordLastVowel, $frontVowels ) ) {
292 $word = $word . "ke";
293 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
294 $word = $word . "qa";
296 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
297 if ( in_array( $wordLastVowel, $frontVowels ) ) {
298 $word = $word . "ge";
299 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
300 $word = $word . "ğa";
305 case "possessive dative": #täweldık + barıs
306 if ( in_array( $wordEnding, $firstPerson ) ) {
307 if ( in_array( $wordLastVowel, $frontVowels ) ) {
309 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
312 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
313 if ( in_array( $wordLastVowel, $frontVowels ) ) {
314 $word = $word . "ge";
315 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
316 $word = $word . "ğa";
318 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
319 if ( in_array( $wordLastVowel, $frontVowels ) ) {
320 $word = $word . "ne";
321 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
322 $word = $word . "na";
327 case "accusative": #tabıs
328 if ( in_array( $wordEnding, $Consonants ) ) {
329 if ( in_array( $wordLastVowel, $frontVowels ) ) {
330 $word = $word . "ti";
331 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
332 $word = $word . "tı";
334 } elseif ( in_array( $wordEnding, $allVowels ) ) {
335 if ( in_array($wordLastVowel, $frontVowels ) ) {
336 $word = $word . "ni";
337 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
338 $word = $word . "nı";
340 } elseif ( in_array( $wordEnding, $Sonorants) ) {
341 if ( in_array( $wordLastVowel, $frontVowels) ) {
342 $word = $word . "di";
343 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
344 $word = $word . "dı";
349 case "possessive accusative": #täweldık + tabıs
350 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
351 if ( in_array( $wordLastVowel, $frontVowels ) ) {
352 $word = $word . "di";
353 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
354 $word = $word . "dı";
356 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
361 case "locative": #jatıs
362 if ( in_array( $wordEnding, $Consonants ) ) {
363 if ( in_array( $wordLastVowel, $frontVowels ) ) {
364 $word = $word . "te";
365 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
366 $word = $word . "ta";
368 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
369 if ( in_array( $wordLastVowel, $frontVowels) ) {
370 $word = $word . "de";
371 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
372 $word = $word . "da";
377 case "possessive locative": #täweldık + jatıs
378 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
379 if ( in_array( $wordLastVowel, $frontVowels ) ) {
380 $word = $word . "de";
381 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
382 $word = $word . "da";
384 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
385 if ( in_array( $wordLastVowel, $frontVowels) ) {
386 $word = $word . "nde";
387 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
388 $word = $word . "nda";
393 case "ablative": #şığıs
394 if ( in_array( $wordEnding, $Consonants ) ) {
395 if ( in_array( $wordLastVowel, $frontVowels ) ) {
396 $word = $word . "ten";
397 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
398 $word = $word . "tan";
400 } elseif ( in_array($wordEnding, $allVowels ) ||
in_array($wordEnding, $Sonants ) ||
in_array($wordEnding, $Sibilants ) ) {
401 if ( in_array( $wordLastVowel, $frontVowels ) ) {
402 $word = $word . "den";
403 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
404 $word = $word . "dan";
406 } elseif ( in_array($wordEnding, $Nasals ) ) {
407 if ( in_array( $wordLastVowel, $frontVowels ) ) {
408 $word = $word . "nen";
409 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
410 $word = $word . "nan";
415 case "possessive ablative": #täweldık + şığıs
416 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
417 if ( in_array( $wordLastVowel, $frontVowels ) ) {
418 $word = $word . "nen";
419 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
420 $word = $word . "nan";
422 } elseif ( in_array($wordEnding, $secondPerson ) ) {
423 if ( in_array( $wordLastVowel, $frontVowels ) ) {
424 $word = $word . "den";
425 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
426 $word = $word . "dan";
431 case "comitative": #kömektes
432 if ( in_array( $wordEnding, $Consonants ) ) {
433 $word = $word . "pen";
434 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
435 $word = $word . "men";
436 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
437 $word = $word . "ben";
441 case "possessive comitative": #täweldık + kömektes
442 if ( in_array( $wordEnding, $Consonants ) ) {
443 $word = $word . "penen";
444 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
445 $word = $word . "menen";
446 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
447 $word = $word . "benen";
450 default: #dc0 #nominative #ataw
455 function convertGrammarKk_arab( $word, $case ) {
456 global $wgGrammarForms;
457 if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
458 return $wgGrammarForms['kk-cn'][$case][$word];
460 if ( isset( $wgGrammarForms['kk-arab'][$case][$word] ) ) {
461 return $wgGrammarForms['kk-arab'][$case][$word];
463 // Set up some constants...
464 // Vowels in last syllable
465 $frontVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" );
466 $backVowels = array( "ا", "و", "ۇ", "ى" );
467 $allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
469 $Nasals = array( "م", "ن", "ڭ" );
470 $Sonants = array( "ي", "ي", "ل", "ر", "ۋ");
471 $Consonants = array( "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" );
472 $Sibilants = array( "ج", "ز" );
473 $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز");
476 $firstPerson = array( "م", "ڭ" ); // 1st singular, 2nd unformal
477 $secondPerson = array( "ز" ); // 1st plural, 2nd formal
478 $thirdPerson = array( "ى", "ٸ" ); // 3rd
480 $lastLetter = self
::lastLetter( $word, $allVowels );
481 $wordEnding =& $lastLetter[0];
482 $wordLastVowel =& $lastLetter[1];
484 // Now convert the word
487 case "genitive": #ilik
488 if ( in_array( $wordEnding, $Consonants ) ) {
489 if ( in_array( $wordLastVowel, $frontVowels ) ) {
490 $word = $word . "تٸڭ";
491 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
492 $word = $word . "تىڭ";
494 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
495 if ( in_array( $wordLastVowel, $frontVowels ) ) {
496 $word = $word . "نٸڭ";
497 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
498 $word = $word . "نىڭ";
500 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants )) {
501 if ( in_array( $wordLastVowel, $frontVowels ) ) {
502 $word = $word . "دٸڭ";
503 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
504 $word = $word . "دىڭ";
509 case "dative": #barıs
510 if ( in_array( $wordEnding, $Consonants ) ) {
511 if ( in_array( $wordLastVowel, $frontVowels ) ) {
512 $word = $word . "كە";
513 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
514 $word = $word . "قا";
516 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
517 if ( in_array( $wordLastVowel, $frontVowels ) ) {
518 $word = $word . "گە";
519 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
520 $word = $word . "عا";
525 case "possessive dative": #täweldık + barıs
526 if ( in_array( $wordEnding, $firstPerson ) ) {
527 if ( in_array( $wordLastVowel, $frontVowels ) ) {
529 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
532 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
533 if ( in_array( $wordLastVowel, $frontVowels ) ) {
534 $word = $word . "گە";
535 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
536 $word = $word . "عا";
538 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
539 if ( in_array( $wordLastVowel, $frontVowels ) ) {
540 $word = $word . "نە";
541 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
542 $word = $word . "نا";
547 case "accusative": #tabıs
548 if ( in_array( $wordEnding, $Consonants ) ) {
549 if ( in_array( $wordLastVowel, $frontVowels ) ) {
550 $word = $word . "تٸ";
551 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
552 $word = $word . "تى";
554 } elseif ( in_array( $wordEnding, $allVowels ) ) {
555 if ( in_array($wordLastVowel, $frontVowels ) ) {
556 $word = $word . "نٸ";
557 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
558 $word = $word . "نى";
560 } elseif ( in_array( $wordEnding, $Sonorants) ) {
561 if ( in_array( $wordLastVowel, $frontVowels) ) {
562 $word = $word . "دٸ";
563 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
564 $word = $word . "دى";
569 case "possessive accusative": #täweldık + tabıs
570 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
571 if ( in_array( $wordLastVowel, $frontVowels ) ) {
572 $word = $word . "دٸ";
573 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
574 $word = $word . "دى";
576 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
581 case "locative": #jatıs
582 if ( in_array( $wordEnding, $Consonants ) ) {
583 if ( in_array( $wordLastVowel, $frontVowels ) ) {
584 $word = $word . "تە";
585 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
586 $word = $word . "تا";
588 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
589 if ( in_array( $wordLastVowel, $frontVowels) ) {
590 $word = $word . "دە";
591 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
592 $word = $word . "دا";
597 case "possessive locative": #täweldık + jatıs
598 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
599 if ( in_array( $wordLastVowel, $frontVowels ) ) {
600 $word = $word . "دە";
601 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
602 $word = $word . "دا";
604 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
605 if ( in_array( $wordLastVowel, $frontVowels) ) {
606 $word = $word . "ندە";
607 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
608 $word = $word . "ندا";
613 case "ablative": #şığıs
614 if ( in_array( $wordEnding, $Consonants ) ) {
615 if ( in_array( $wordLastVowel, $frontVowels ) ) {
616 $word = $word . "تەن";
617 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
618 $word = $word . "تان";
620 } elseif ( in_array($wordEnding, $allVowels ) ||
in_array($wordEnding, $Sonants ) ||
in_array($wordEnding, $Sibilants ) ) {
621 if ( in_array( $wordLastVowel, $frontVowels ) ) {
622 $word = $word . "دەن";
623 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
624 $word = $word . "دان";
626 } elseif ( in_array($wordEnding, $Nasals ) ) {
627 if ( in_array( $wordLastVowel, $frontVowels ) ) {
628 $word = $word . "نەن";
629 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
630 $word = $word . "نان";
635 case "possessive ablative": #täweldık + şığıs
636 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
637 if ( in_array( $wordLastVowel, $frontVowels ) ) {
638 $word = $word . "نەن";
639 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
640 $word = $word . "نان";
642 } elseif ( in_array($wordEnding, $secondPerson ) ) {
643 if ( in_array( $wordLastVowel, $frontVowels ) ) {
644 $word = $word . "دەن";
645 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
646 $word = $word . "دان";
651 case "comitative": #kömektes
652 if ( in_array( $wordEnding, $Consonants ) ) {
653 $word = $word . "پەن";
654 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
655 $word = $word . "مەن";
656 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
657 $word = $word . "بەن";
661 case "possessive comitative": #täweldık + kömektes
662 if ( in_array( $wordEnding, $Consonants ) ) {
663 $word = $word . "پەنەن";
664 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ||
in_array( $wordEnding, $Sonants ) ) {
665 $word = $word . "مەنەن";
666 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
667 $word = $word . "بەنەن";
670 default: #dc0 #nominative #ataw
675 function lastLetter( $word, $allVowels ) {
676 $lastLetter = array();
679 // Put the word in a form we can play with since we're using UTF-8
680 $ar = preg_split('//u', parent
::lc($word), -1, PREG_SPLIT_NO_EMPTY
);
682 // Here's an array with the order of the letters in the word reversed
683 // so we can find a match quicker *shrug*
684 $wordReversed = array_reverse( $ar );
686 // Here's the last letter in the word
687 $lastLetter[0] = $ar[count( $ar ) - 1];
689 // Find the last vowel in the word
690 $lastLetter[1] = NULL;
691 foreach ( $wordReversed as $xvalue ) {
692 foreach ( $allVowels as $yvalue ) {
693 if ( strcmp( $xvalue, $yvalue ) == 0 ) {
694 $lastLetter[1] = $xvalue;
700 if ( $lastLetter[1] !== NULL ) {
711 * Avoid grouping whole numbers between 0 to 9999
713 function commafy( $_ ) {
714 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
715 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );