24 define(
'KK_C_UC',
'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
25 define(
'KK_C_LC',
'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
26 define(
'KK_L_UC',
'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase
27 define(
'KK_L_LC',
'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazakh Latin lowercase
29 define(
'H_HAMZA',
'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA
49 $variantfallbacks = [],
52 parent::__construct( $langobj, $maincode,
53 $variants, $variantfallbacks, $flags );
84 $this->mTables[
'kk-kz']->merge( $this->mTables[
'kk-cyrl'] );
85 $this->mTables[
'kk-tr']->merge( $this->mTables[
'kk-latn'] );
86 $this->mTables[
'kk-cn']->merge( $this->mTables[
'kk-arab'] );
94 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' =>
'$1YE',
95 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1ye',
97 '/^Ё([' .
KK_C_UC .
']|$)/u' =>
'YO$1',
'/^Ё([' .
KK_C_LC .
']|$)/u' =>
'Yo$1',
98 '/^Ю([' .
KK_C_UC .
']|$)/u' =>
'YU$1',
'/^Ю([' .
KK_C_LC .
']|$)/u' =>
'Yu$1',
99 '/^Я([' .
KK_C_UC .
']|$)/u' =>
'YA$1',
'/^Я([' .
KK_C_LC .
']|$)/u' =>
'Ya$1',
100 '/^Щ([' .
KK_C_UC .
']|$)/u' =>
'ŞÇ$1',
'/^Щ([' .
KK_C_LC .
']|$)/u' =>
'Şç$1',
102 '/Ё/u' =>
'YO',
'/ё/u' =>
'yo',
103 '/Ю/u' =>
'YU',
'/ю/u' =>
'yu',
104 '/Я/u' =>
'YA',
'/я/u' =>
'ya',
105 '/Щ/u' =>
'ŞÇ',
'/щ/u' =>
'şç',
106 # # soft and hard signs
107 '/[ъЪ]/u' =>
'ʺ',
'/[ьЬ]/u' =>
'ʹ',
109 '/А/u' =>
'A',
'/а/u' =>
'a',
'/Ә/u' =>
'Ä',
'/ә/u' =>
'ä',
110 '/Б/u' =>
'B',
'/б/u' =>
'b',
'/В/u' =>
'V',
'/в/u' =>
'v',
111 '/Г/u' =>
'G',
'/г/u' =>
'g',
'/Ғ/u' =>
'Ğ',
'/ғ/u' =>
'ğ',
112 '/Д/u' =>
'D',
'/д/u' =>
'd',
'/Е/u' =>
'E',
'/е/u' =>
'e',
113 '/Ж/u' =>
'J',
'/ж/u' =>
'j',
'/З/u' =>
'Z',
'/з/u' =>
'z',
114 '/И/u' =>
'Ï',
'/и/u' =>
'ï',
'/Й/u' =>
'Ý',
'/й/u' =>
'ý',
115 '/К/u' =>
'K',
'/к/u' =>
'k',
'/Қ/u' =>
'Q',
'/қ/u' =>
'q',
116 '/Л/u' =>
'L',
'/л/u' =>
'l',
'/М/u' =>
'M',
'/м/u' =>
'm',
117 '/Н/u' =>
'N',
'/н/u' =>
'n',
'/Ң/u' =>
'Ñ',
'/ң/u' =>
'ñ',
118 '/О/u' =>
'O',
'/о/u' =>
'o',
'/Ө/u' =>
'Ö',
'/ө/u' =>
'ö',
119 '/П/u' =>
'P',
'/п/u' =>
'p',
'/Р/u' =>
'R',
'/р/u' =>
'r',
120 '/С/u' =>
'S',
'/с/u' =>
's',
'/Т/u' =>
'T',
'/т/u' =>
't',
121 '/У/u' =>
'W',
'/у/u' =>
'w',
'/Ұ/u' =>
'U',
'/ұ/u' =>
'u',
122 '/Ү/u' =>
'Ü',
'/ү/u' =>
'ü',
'/Ф/u' =>
'F',
'/ф/u' =>
'f',
123 '/Х/u' =>
'X',
'/х/u' =>
'x',
'/Һ/u' =>
'H',
'/һ/u' =>
'h',
124 '/Ц/u' =>
'C',
'/ц/u' =>
'c',
'/Ч/u' =>
'Ç',
'/ч/u' =>
'ç',
125 '/Ш/u' =>
'Ş',
'/ш/u' =>
'ş',
'/Ы/u' =>
'I',
'/ы/u' =>
'ı',
126 '/І/u' =>
'İ',
'/і/u' =>
'i',
'/Э/u' =>
'É',
'/э/u' =>
'é',
129 $this->mLatn2Cyrl = [
133 '/ŞÇʹ/u' =>
'ЩЬ',
'/Şçʹ/u' =>
'Щь',
134 '/Ş[Çç]/u' =>
'Щ',
'/şç/u' =>
'щ',
135 # # soft and hard signs
137 '/ʺ([' .
KK_L_LC .
'])/u' =>
'ъ$1',
139 '/ʹ([' .
KK_L_LC .
'])/u' =>
'ь$1',
143 '/Y[Ee]/u' =>
'Е',
'/ye/u' =>
'е',
144 '/Y[Oo]/u' =>
'Ё',
'/yo/u' =>
'ё',
145 '/Y[UWuw]/u' =>
'Ю',
'/y[uw]/u' =>
'ю',
146 '/Y[Aa]/u' =>
'Я',
'/ya/u' =>
'я',
148 '/A/u' =>
'А',
'/a/u' =>
'а',
'/Ä/u' =>
'Ә',
'/ä/u' =>
'ә',
149 '/B/u' =>
'Б',
'/b/u' =>
'б',
'/C/u' =>
'Ц',
'/c/u' =>
'ц',
150 '/Ç/u' =>
'Ч',
'/ç/u' =>
'ч',
'/D/u' =>
'Д',
'/d/u' =>
'д',
151 '/E/u' =>
'Е',
'/e/u' =>
'е',
'/É/u' =>
'Э',
'/é/u' =>
'э',
152 '/F/u' =>
'Ф',
'/f/u' =>
'ф',
'/G/u' =>
'Г',
'/g/u' =>
'г',
153 '/Ğ/u' =>
'Ғ',
'/ğ/u' =>
'ғ',
'/H/u' =>
'Һ',
'/h/u' =>
'һ',
154 '/I/u' =>
'Ы',
'/ı/u' =>
'ы',
'/İ/u' =>
'І',
'/i/u' =>
'і',
155 '/Ï/u' =>
'И',
'/ï/u' =>
'и',
'/J/u' =>
'Ж',
'/j/u' =>
'ж',
156 '/K/u' =>
'К',
'/k/u' =>
'к',
'/L/u' =>
'Л',
'/l/u' =>
'л',
157 '/M/u' =>
'М',
'/m/u' =>
'м',
'/N/u' =>
'Н',
'/n/u' =>
'н',
158 '/Ñ/u' =>
'Ң',
'/ñ/u' =>
'ң',
'/O/u' =>
'О',
'/o/u' =>
'о',
159 '/Ö/u' =>
'Ө',
'/ö/u' =>
'ө',
'/P/u' =>
'П',
'/p/u' =>
'п',
160 '/Q/u' =>
'Қ',
'/q/u' =>
'қ',
'/R/u' =>
'Р',
'/r/u' =>
'р',
161 '/S/u' =>
'С',
'/s/u' =>
'с',
'/Ş/u' =>
'Ш',
'/ş/u' =>
'ш',
162 '/T/u' =>
'Т',
'/t/u' =>
'т',
'/U/u' =>
'Ұ',
'/u/u' =>
'ұ',
163 '/Ü/u' =>
'Ү',
'/ü/u' =>
'ү',
'/V/u' =>
'В',
'/v/u' =>
'в',
164 '/W/u' =>
'У',
'/w/u' =>
'у',
'/Ý/u' =>
'Й',
'/ý/u' =>
'й',
165 '/X/u' =>
'Х',
'/x/u' =>
'х',
'/Z/u' =>
'З',
'/z/u' =>
'з',
168 $this->mCyLa2Arab = [
169 # # Punctuation -> Arabic
170 '/#|№|No\./u' =>
'', # U+0600
171 '/\,/' =>
'،', # U+060C
172 '/;/' =>
'؛', # U+061B
173 '/\?/' =>
'؟', # U+061F
174 '/%/' =>
'٪', # U+066A
175 '/\*/' =>
'٭', # U+066D
177 '/0/' =>
'۰', # U+06F0
178 '/1/' =>
'۱', # U+06F1
179 '/2/' =>
'۲', # U+06F2
180 '/3/' =>
'۳', # U+06F3
181 '/4/' =>
'۴', # U+06F4
182 '/5/' =>
'۵', # U+06F5
183 '/6/' =>
'۶', # U+06F6
184 '/7/' =>
'۷', # U+06F7
185 '/8/' =>
'۸', # U+06F8
186 '/9/' =>
'۹', # U+06F9
187 # # Cyrillic -> Arabic
189 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1يە',
190 '/[еэ]/ui' =>
'ە',
'/[ъь]/ui' =>
'',
191 '/[аә]/ui' =>
'ا',
'/[оө]/ui' =>
'و',
'/[ұү]/ui' =>
'ۇ',
'/[ыі]/ui' =>
'ى',
192 '/[и]/ui' =>
'ىي',
'/ё/ui' =>
'يو',
'/ю/ui' =>
'يۋ',
'/я/ui' =>
'يا',
'/[й]/ui' =>
'ي',
193 '/ц/ui' =>
'تس',
'/щ/ui' =>
'شش',
194 '/һ/ui' =>
'ح',
'/ч/ui' =>
'تش',
195 # '/һ/ui' => 'ھ', '/ч/ui' => 'چ',
196 '/б/ui' =>
'ب',
'/в/ui' =>
'ۆ',
'/г/ui' =>
'گ',
'/ғ/ui' =>
'ع',
197 '/д/ui' =>
'د',
'/ж/ui' =>
'ج',
'/з/ui' =>
'ز',
'/к/ui' =>
'ك',
198 '/қ/ui' =>
'ق',
'/л/ui' =>
'ل',
'/м/ui' =>
'م',
'/н/ui' =>
'ن',
199 '/ң/ui' =>
'ڭ',
'/п/ui' =>
'پ',
'/р/ui' =>
'ر',
'/с/ui' =>
'س',
200 '/т/ui' =>
'ت',
'/у/ui' =>
'ۋ',
'/ф/ui' =>
'ف',
'/х/ui' =>
'ح',
202 # # Latin -> Arabic // commented for now...
231 if ( is_object( $nt ) ) {
232 $ns = $nt->getNamespace();
239 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
254 $text = parent::translate( $text, $toVariant );
256 switch ( $toVariant ) {
273 $varsfix =
'\$[0-9]';
276 '/' . $varsfix .
'[^' . $letters .
']+/u',
279 PREG_SPLIT_OFFSET_CAPTURE
286 $ret .= substr( $text, $mstart, $m[1] - $mstart );
288 $mstart = $m[1] + strlen( $m[0] );
304 switch ( $toVariant ) {
309 $excludes =
'еэгғкқЕЭГҒКҚ';
311 $matches = preg_split(
'/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
315 $ret .= substr( $text, $mstart, $m[1] - $mstart );
319 if ( preg_match(
'/[' . $front .
']/u', $m[0] ) &&
320 !preg_match(
'/[' . $excludes .
']/u', $m[0] )
322 $ret .= preg_replace(
'/[' . $letters .
']+/u',
H_HAMZA .
'$0', $m[0] );
326 $mstart = $m[1] + strlen( $m[0] );
329 foreach ( $this->mCyLa2Arab as $pat => $rep ) {
330 $text = preg_replace( $pat, $rep, $text );
335 foreach ( $this->mCyrl2Latn as $pat => $rep ) {
336 $text = preg_replace( $pat, $rep, $text );
341 foreach ( $this->mLatn2Cyrl as $pat => $rep ) {
342 $text = preg_replace( $pat, $rep, $text );
367 parent::__construct();
369 $variants = [
'kk',
'kk-cyrl',
'kk-latn',
'kk-arab',
'kk-kz',
'kk-tr',
'kk-cn' ];
370 $variantfallbacks = [
375 'kk-kz' =>
'kk-cyrl',
376 'kk-tr' =>
'kk-latn',
380 $this->mConverter =
new KkConverter( $this,
'kk', $variants, $variantfallbacks );
391 if ( substr( $string, 0, 1 ) ===
'i' ) {
393 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
394 return 'İ' . substr( $string, 1 );
397 return parent::ucfirst( $string );
408 if ( substr( $string, 0, 1 ) ===
'I' ) {
410 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
411 return 'ı' . substr( $string, 1 );
414 return parent::lcfirst( $string );
424 switch ( $variant ) {
427 $word = parent::convertGrammarKk_arab( $word, $case );
431 $word = parent::convertGrammarKk_latn( $word, $case );
437 $word = parent::convertGrammarKk_cyrl( $word, $case );