00001 <?php
00007 class LanguageKk_cyrl extends Language {
00008
00009 # Convert from the nominative form of a noun to some other case
00010 # Invoked with {{GRAMMAR:case|word}}
00011
00015 function convertGrammarKk_cyrl( $word, $case ) {
00016 global $wgGrammarForms;
00017 if ( isset( $wgGrammarForms['kk-kz'][$case][$word] ) ) {
00018 return $wgGrammarForms['kk-kz'][$case][$word];
00019 }
00020 if ( isset( $wgGrammarForms['kk-cyrl'][$case][$word] ) ) {
00021 return $wgGrammarForms['kk-cyrl'][$case][$word];
00022 }
00023
00024
00025 $frontVowels = array( "е", "ө", "ү", "і", "ә", "э", "я", "ё", "и" );
00026 $backVowels = array( "а", "о", "ұ", "ы" );
00027 $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" );
00028
00029 $Nasals = array( "м", "н", "ң" );
00030 $Sonants = array( "и", "й", "л", "р", "у", "ю");
00031 $Consonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" );
00032 $Sibilants = array( "ж", "з" );
00033 $Sonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з");
00034
00035
00036 $firstPerson = array( "м", "ң" );
00037 $secondPerson = array( "з" );
00038 $thirdPerson = array( "ы", "і" );
00039
00040 $lastLetter = self::lastLetter( $word, $allVowels );
00041 $wordEnding =& $lastLetter[0];
00042 $wordLastVowel =& $lastLetter[1];
00043
00044
00045 switch ( $case ) {
00046 case "dc1":
00047 case "genitive": #ilik
00048 if ( in_array( $wordEnding, $Consonants ) ) {
00049 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00050 $word = $word . "тің";
00051 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00052 $word = $word . "тың";
00053 }
00054 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
00055 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00056 $word = $word . "нің";
00057 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00058 $word = $word . "ның";
00059 }
00060 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) {
00061 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00062 $word = $word . "дің";
00063 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00064 $word = $word . "дың";
00065 }
00066 }
00067 break;
00068 case "dc2":
00069 case "dative": #barıs
00070 if ( in_array( $wordEnding, $Consonants ) ) {
00071 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00072 $word = $word . "ке";
00073 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00074 $word = $word . "қа";
00075 }
00076 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
00077 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00078 $word = $word . "ге";
00079 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00080 $word = $word . "ға";
00081 }
00082 }
00083 break;
00084 case "dc21":
00085 case "possessive dative": #täweldık + barıs
00086 if ( in_array( $wordEnding, $firstPerson ) ) {
00087 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00088 $word = $word . "е";
00089 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00090 $word = $word . "а";
00091 }
00092 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
00093 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00094 $word = $word . "ге";
00095 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00096 $word = $word . "ға";
00097 }
00098 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00099 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00100 $word = $word . "не";
00101 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00102 $word = $word . "на";
00103 }
00104 }
00105 break;
00106 case "dc3":
00107 case "accusative": #tabıs
00108 if ( in_array( $wordEnding, $Consonants ) ) {
00109 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00110 $word = $word . "ті";
00111 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00112 $word = $word . "ты";
00113 }
00114 } elseif ( in_array( $wordEnding, $allVowels ) ) {
00115 if ( in_array($wordLastVowel, $frontVowels ) ) {
00116 $word = $word . "ні";
00117 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00118 $word = $word . "ны";
00119 }
00120 } elseif ( in_array( $wordEnding, $Sonorants) ) {
00121 if ( in_array( $wordLastVowel, $frontVowels) ) {
00122 $word = $word . "ді";
00123 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00124 $word = $word . "ды";
00125 }
00126 }
00127 break;
00128 case "dc31":
00129 case "possessive accusative": #täweldık + tabıs
00130 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
00131 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00132 $word = $word . "ді";
00133 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00134 $word = $word . "ды";
00135 }
00136 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00137 $word = $word . "н";
00138 }
00139 break;
00140 case "dc4":
00141 case "locative": #jatıs
00142 if ( in_array( $wordEnding, $Consonants ) ) {
00143 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00144 $word = $word . "те";
00145 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00146 $word = $word . "та";
00147 }
00148 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
00149 if ( in_array( $wordLastVowel, $frontVowels) ) {
00150 $word = $word . "де";
00151 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00152 $word = $word . "да";
00153 }
00154 }
00155 break;
00156 case "dc41":
00157 case "possessive locative": #täweldık + jatıs
00158 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
00159 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00160 $word = $word . "де";
00161 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00162 $word = $word . "да";
00163 }
00164 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00165 if ( in_array( $wordLastVowel, $frontVowels) ) {
00166 $word = $word . "нде";
00167 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00168 $word = $word . "нда";
00169 }
00170 }
00171 break;
00172 case "dc5":
00173 case "ablative": #şığıs
00174 if ( in_array( $wordEnding, $Consonants ) ) {
00175 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00176 $word = $word . "тен";
00177 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00178 $word = $word . "тан";
00179 }
00180 } elseif ( in_array($wordEnding, $allVowels ) || in_array($wordEnding, $Sonants ) || in_array($wordEnding, $Sibilants ) ) {
00181 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00182 $word = $word . "ден";
00183 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00184 $word = $word . "дан";
00185 }
00186 } elseif ( in_array($wordEnding, $Nasals ) ) {
00187 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00188 $word = $word . "нен";
00189 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00190 $word = $word . "нан";
00191 }
00192 }
00193 break;
00194 case "dc51":
00195 case "possessive ablative": #täweldık + şığıs
00196 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
00197 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00198 $word = $word . "нен";
00199 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00200 $word = $word . "нан";
00201 }
00202 } elseif ( in_array($wordEnding, $secondPerson ) ) {
00203 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00204 $word = $word . "ден";
00205 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00206 $word = $word . "дан";
00207 }
00208 }
00209 break;
00210 case "dc6":
00211 case "comitative": #kömektes
00212 if ( in_array( $wordEnding, $Consonants ) ) {
00213 $word = $word . "пен";
00214 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
00215 $word = $word . "мен";
00216 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
00217 $word = $word . "бен";
00218 }
00219 break;
00220 case "dc61":
00221 case "possessive comitative": #täweldık + kömektes
00222 if ( in_array( $wordEnding, $Consonants ) ) {
00223 $word = $word . "пенен";
00224 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
00225 $word = $word . "менен";
00226 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
00227 $word = $word . "бенен";
00228 }
00229 break;
00230 default: #dc0 #nominative #ataw
00231 }
00232 return $word;
00233 }
00234
00235 function convertGrammarKk_latn( $word, $case ) {
00236 global $wgGrammarForms;
00237 if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
00238 return $wgGrammarForms['kk-tr'][$case][$word];
00239 }
00240 if ( isset( $wgGrammarForms['kk-latn'][$case][$word] ) ) {
00241 return $wgGrammarForms['kk-latn'][$case][$word];
00242 }
00243
00244
00245 $frontVowels = array( "e", "ö", "ü", "i", "ä", "é" );
00246 $backVowels = array( "a", "o", "u", "ı" );
00247 $allVowels = array( "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" );
00248
00249 $Nasals = array( "m", "n", "ñ" );
00250 $Sonants = array( "ï", "y", "ý", "l", "r", "w");
00251 $Consonants = array( "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" );
00252 $Sibilants = array( "j", "z" );
00253 $Sonorants = array( "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z");
00254
00255
00256 $firstPerson = array( "m", "ñ" );
00257 $secondPerson = array( "z" );
00258 $thirdPerson = array( "ı", "i" );
00259
00260 $lastLetter = self::lastLetter( $word, $allVowels );
00261 $wordEnding =& $lastLetter[0];
00262 $wordLastVowel =& $lastLetter[1];
00263
00264
00265 switch ( $case ) {
00266 case "dc1":
00267 case "genitive": #ilik
00268 if ( in_array( $wordEnding, $Consonants ) ) {
00269 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00270 $word = $word . "tiñ";
00271 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00272 $word = $word . "tıñ";
00273 }
00274 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
00275 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00276 $word = $word . "niñ";
00277 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00278 $word = $word . "nıñ";
00279 }
00280 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) {
00281 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00282 $word = $word . "diñ";
00283 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00284 $word = $word . "dıñ";
00285 }
00286 }
00287 break;
00288 case "dc2":
00289 case "dative": #barıs
00290 if ( in_array( $wordEnding, $Consonants ) ) {
00291 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00292 $word = $word . "ke";
00293 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00294 $word = $word . "qa";
00295 }
00296 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
00297 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00298 $word = $word . "ge";
00299 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00300 $word = $word . "ğa";
00301 }
00302 }
00303 break;
00304 case "dc21":
00305 case "possessive dative": #täweldık + barıs
00306 if ( in_array( $wordEnding, $firstPerson ) ) {
00307 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00308 $word = $word . "e";
00309 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00310 $word = $word . "a";
00311 }
00312 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
00313 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00314 $word = $word . "ge";
00315 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00316 $word = $word . "ğa";
00317 }
00318 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00319 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00320 $word = $word . "ne";
00321 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00322 $word = $word . "na";
00323 }
00324 }
00325 break;
00326 case "dc3":
00327 case "accusative": #tabıs
00328 if ( in_array( $wordEnding, $Consonants ) ) {
00329 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00330 $word = $word . "ti";
00331 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00332 $word = $word . "tı";
00333 }
00334 } elseif ( in_array( $wordEnding, $allVowels ) ) {
00335 if ( in_array($wordLastVowel, $frontVowels ) ) {
00336 $word = $word . "ni";
00337 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00338 $word = $word . "nı";
00339 }
00340 } elseif ( in_array( $wordEnding, $Sonorants) ) {
00341 if ( in_array( $wordLastVowel, $frontVowels) ) {
00342 $word = $word . "di";
00343 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00344 $word = $word . "dı";
00345 }
00346 }
00347 break;
00348 case "dc31":
00349 case "possessive accusative": #täweldık + tabıs
00350 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
00351 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00352 $word = $word . "di";
00353 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00354 $word = $word . "dı";
00355 }
00356 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00357 $word = $word . "n";
00358 }
00359 break;
00360 case "dc4":
00361 case "locative": #jatıs
00362 if ( in_array( $wordEnding, $Consonants ) ) {
00363 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00364 $word = $word . "te";
00365 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00366 $word = $word . "ta";
00367 }
00368 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
00369 if ( in_array( $wordLastVowel, $frontVowels) ) {
00370 $word = $word . "de";
00371 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00372 $word = $word . "da";
00373 }
00374 }
00375 break;
00376 case "dc41":
00377 case "possessive locative": #täweldık + jatıs
00378 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
00379 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00380 $word = $word . "de";
00381 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00382 $word = $word . "da";
00383 }
00384 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00385 if ( in_array( $wordLastVowel, $frontVowels) ) {
00386 $word = $word . "nde";
00387 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00388 $word = $word . "nda";
00389 }
00390 }
00391 break;
00392 case "dc5":
00393 case "ablative": #şığıs
00394 if ( in_array( $wordEnding, $Consonants ) ) {
00395 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00396 $word = $word . "ten";
00397 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00398 $word = $word . "tan";
00399 }
00400 } elseif ( in_array($wordEnding, $allVowels ) || in_array($wordEnding, $Sonants ) || in_array($wordEnding, $Sibilants ) ) {
00401 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00402 $word = $word . "den";
00403 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00404 $word = $word . "dan";
00405 }
00406 } elseif ( in_array($wordEnding, $Nasals ) ) {
00407 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00408 $word = $word . "nen";
00409 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00410 $word = $word . "nan";
00411 }
00412 }
00413 break;
00414 case "dc51":
00415 case "possessive ablative": #täweldık + şığıs
00416 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
00417 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00418 $word = $word . "nen";
00419 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00420 $word = $word . "nan";
00421 }
00422 } elseif ( in_array($wordEnding, $secondPerson ) ) {
00423 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00424 $word = $word . "den";
00425 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00426 $word = $word . "dan";
00427 }
00428 }
00429 break;
00430 case "dc6":
00431 case "comitative": #kömektes
00432 if ( in_array( $wordEnding, $Consonants ) ) {
00433 $word = $word . "pen";
00434 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
00435 $word = $word . "men";
00436 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
00437 $word = $word . "ben";
00438 }
00439 break;
00440 case "dc61":
00441 case "possessive comitative": #täweldık + kömektes
00442 if ( in_array( $wordEnding, $Consonants ) ) {
00443 $word = $word . "penen";
00444 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
00445 $word = $word . "menen";
00446 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
00447 $word = $word . "benen";
00448 }
00449 break;
00450 default: #dc0 #nominative #ataw
00451 }
00452 return $word;
00453 }
00454
00455 function convertGrammarKk_arab( $word, $case ) {
00456 global $wgGrammarForms;
00457 if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
00458 return $wgGrammarForms['kk-cn'][$case][$word];
00459 }
00460 if ( isset( $wgGrammarForms['kk-arab'][$case][$word] ) ) {
00461 return $wgGrammarForms['kk-arab'][$case][$word];
00462 }
00463
00464
00465 $frontVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" );
00466 $backVowels = array( "ا", "و", "ۇ", "ى" );
00467 $allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
00468
00469 $Nasals = array( "م", "ن", "ڭ" );
00470 $Sonants = array( "ي", "ي", "ل", "ر", "ۋ");
00471 $Consonants = array( "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" );
00472 $Sibilants = array( "ج", "ز" );
00473 $Sonorants = array( "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز");
00474
00475
00476 $firstPerson = array( "م", "ڭ" );
00477 $secondPerson = array( "ز" );
00478 $thirdPerson = array( "ى", "ٸ" );
00479
00480 $lastLetter = self::lastLetter( $word, $allVowels );
00481 $wordEnding =& $lastLetter[0];
00482 $wordLastVowel =& $lastLetter[1];
00483
00484
00485 switch ( $case ) {
00486 case "dc1":
00487 case "genitive": #ilik
00488 if ( in_array( $wordEnding, $Consonants ) ) {
00489 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00490 $word = $word . "تٸڭ";
00491 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00492 $word = $word . "تىڭ";
00493 }
00494 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) ) {
00495 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00496 $word = $word . "نٸڭ";
00497 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00498 $word = $word . "نىڭ";
00499 }
00500 } elseif ( in_array( $wordEnding, $Sonants ) || in_array( $wordEnding, $Sibilants )) {
00501 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00502 $word = $word . "دٸڭ";
00503 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00504 $word = $word . "دىڭ";
00505 }
00506 }
00507 break;
00508 case "dc2":
00509 case "dative": #barıs
00510 if ( in_array( $wordEnding, $Consonants ) ) {
00511 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00512 $word = $word . "كە";
00513 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00514 $word = $word . "قا";
00515 }
00516 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
00517 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00518 $word = $word . "گە";
00519 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00520 $word = $word . "عا";
00521 }
00522 }
00523 break;
00524 case "dc21":
00525 case "possessive dative": #täweldık + barıs
00526 if ( in_array( $wordEnding, $firstPerson ) ) {
00527 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00528 $word = $word . "ە";
00529 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00530 $word = $word . "ا";
00531 }
00532 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
00533 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00534 $word = $word . "گە";
00535 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00536 $word = $word . "عا";
00537 }
00538 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00539 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00540 $word = $word . "نە";
00541 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00542 $word = $word . "نا";
00543 }
00544 }
00545 break;
00546 case "dc3":
00547 case "accusative": #tabıs
00548 if ( in_array( $wordEnding, $Consonants ) ) {
00549 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00550 $word = $word . "تٸ";
00551 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00552 $word = $word . "تى";
00553 }
00554 } elseif ( in_array( $wordEnding, $allVowels ) ) {
00555 if ( in_array($wordLastVowel, $frontVowels ) ) {
00556 $word = $word . "نٸ";
00557 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00558 $word = $word . "نى";
00559 }
00560 } elseif ( in_array( $wordEnding, $Sonorants) ) {
00561 if ( in_array( $wordLastVowel, $frontVowels) ) {
00562 $word = $word . "دٸ";
00563 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00564 $word = $word . "دى";
00565 }
00566 }
00567 break;
00568 case "dc31":
00569 case "possessive accusative": #täweldık + tabıs
00570 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
00571 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00572 $word = $word . "دٸ";
00573 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00574 $word = $word . "دى";
00575 }
00576 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00577 $word = $word . "ن";
00578 }
00579 break;
00580 case "dc4":
00581 case "locative": #jatıs
00582 if ( in_array( $wordEnding, $Consonants ) ) {
00583 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00584 $word = $word . "تە";
00585 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00586 $word = $word . "تا";
00587 }
00588 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Sonorants ) ) {
00589 if ( in_array( $wordLastVowel, $frontVowels) ) {
00590 $word = $word . "دە";
00591 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00592 $word = $word . "دا";
00593 }
00594 }
00595 break;
00596 case "dc41":
00597 case "possessive locative": #täweldık + jatıs
00598 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
00599 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00600 $word = $word . "دە";
00601 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00602 $word = $word . "دا";
00603 }
00604 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
00605 if ( in_array( $wordLastVowel, $frontVowels) ) {
00606 $word = $word . "ندە";
00607 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00608 $word = $word . "ندا";
00609 }
00610 }
00611 break;
00612 case "dc5":
00613 case "ablative": #şığıs
00614 if ( in_array( $wordEnding, $Consonants ) ) {
00615 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00616 $word = $word . "تەن";
00617 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00618 $word = $word . "تان";
00619 }
00620 } elseif ( in_array($wordEnding, $allVowels ) || in_array($wordEnding, $Sonants ) || in_array($wordEnding, $Sibilants ) ) {
00621 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00622 $word = $word . "دەن";
00623 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00624 $word = $word . "دان";
00625 }
00626 } elseif ( in_array($wordEnding, $Nasals ) ) {
00627 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00628 $word = $word . "نەن";
00629 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00630 $word = $word . "نان";
00631 }
00632 }
00633 break;
00634 case "dc51":
00635 case "possessive ablative": #täweldık + şığıs
00636 if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
00637 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00638 $word = $word . "نەن";
00639 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00640 $word = $word . "نان";
00641 }
00642 } elseif ( in_array($wordEnding, $secondPerson ) ) {
00643 if ( in_array( $wordLastVowel, $frontVowels ) ) {
00644 $word = $word . "دەن";
00645 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
00646 $word = $word . "دان";
00647 }
00648 }
00649 break;
00650 case "dc6":
00651 case "comitative": #kömektes
00652 if ( in_array( $wordEnding, $Consonants ) ) {
00653 $word = $word . "پەن";
00654 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
00655 $word = $word . "مەن";
00656 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
00657 $word = $word . "بەن";
00658 }
00659 break;
00660 case "dc61":
00661 case "possessive comitative": #täweldık + kömektes
00662 if ( in_array( $wordEnding, $Consonants ) ) {
00663 $word = $word . "پەنەن";
00664 } elseif ( in_array( $wordEnding, $allVowels ) || in_array( $wordEnding, $Nasals ) || in_array( $wordEnding, $Sonants ) ) {
00665 $word = $word . "مەنەن";
00666 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
00667 $word = $word . "بەنەن";
00668 }
00669 break;
00670 default: #dc0 #nominative #ataw
00671 }
00672 return $word;
00673 }
00674
00675 function lastLetter( $word, $allVowels ) {
00676 $lastLetter = array();
00677 $ar = array();
00678
00679
00680 $ar = preg_split('//u', parent::lc($word), -1, PREG_SPLIT_NO_EMPTY);
00681
00682
00683
00684 $wordReversed = array_reverse( $ar );
00685
00686
00687 $lastLetter[0] = $ar[count( $ar ) - 1];
00688
00689
00690 $lastLetter[1] = NULL;
00691 foreach ( $wordReversed as $xvalue ) {
00692 foreach ( $allVowels as $yvalue ) {
00693 if ( strcmp( $xvalue, $yvalue ) == 0 ) {
00694 $lastLetter[1] = $xvalue;
00695 break;
00696 } else {
00697 continue;
00698 }
00699 }
00700 if ( $lastLetter[1] !== NULL ) {
00701 break;
00702 } else {
00703 continue;
00704 }
00705 }
00706
00707 return $lastLetter;
00708 }
00709
00713 function commafy( $_ ) {
00714 if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
00715 return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );
00716 } else {
00717 return $_;
00718 }
00719 }
00720 }