24define(
'KK_C_UC',
'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
25define(
'KK_C_LC',
'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
26define(
'KK_L_UC',
'AÄBCÇDEÉFGĞHIİÏJKLMNÑOÖPQRSŞTUÜVWXYÝZ' ); # Kazakh Latin uppercase
27define(
'KK_L_LC',
'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazakh Latin lowercase
29define(
'H_HAMZA',
'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA
45 $variants = [
'kk',
'kk-cyrl',
'kk-latn',
'kk-arab',
'kk-kz',
'kk-tr',
'kk-cn' ];
56 parent::__construct( $langobj,
'kk',
57 $variants, $variantfallbacks, [] );
88 $this->mTables[
'kk-kz']->merge( $this->mTables[
'kk-cyrl'] );
89 $this->mTables[
'kk-tr']->merge( $this->mTables[
'kk-latn'] );
90 $this->mTables[
'kk-cn']->merge( $this->mTables[
'kk-arab'] );
98 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' =>
'$1YE',
99 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1ye',
101 '/^Ё([' .
KK_C_UC .
']|$)/u' =>
'YO$1',
'/^Ё([' .
KK_C_LC .
']|$)/u' =>
'Yo$1',
102 '/^Ю([' .
KK_C_UC .
']|$)/u' =>
'YU$1',
'/^Ю([' .
KK_C_LC .
']|$)/u' =>
'Yu$1',
103 '/^Я([' .
KK_C_UC .
']|$)/u' =>
'YA$1',
'/^Я([' .
KK_C_LC .
']|$)/u' =>
'Ya$1',
104 '/^Щ([' .
KK_C_UC .
']|$)/u' =>
'ŞÇ$1',
'/^Щ([' .
KK_C_LC .
']|$)/u' =>
'Şç$1',
106 '/Ё/u' =>
'YO',
'/ё/u' =>
'yo',
107 '/Ю/u' =>
'YU',
'/ю/u' =>
'yu',
108 '/Я/u' =>
'YA',
'/я/u' =>
'ya',
109 '/Щ/u' =>
'ŞÇ',
'/щ/u' =>
'şç',
110 # # soft and hard signs
111 '/[ъЪ]/u' =>
'ʺ',
'/[ьЬ]/u' =>
'ʹ',
113 '/А/u' =>
'A',
'/а/u' =>
'a',
'/Ә/u' =>
'Ä',
'/ә/u' =>
'ä',
114 '/Б/u' =>
'B',
'/б/u' =>
'b',
'/В/u' =>
'V',
'/в/u' =>
'v',
115 '/Г/u' =>
'G',
'/г/u' =>
'g',
'/Ғ/u' =>
'Ğ',
'/ғ/u' =>
'ğ',
116 '/Д/u' =>
'D',
'/д/u' =>
'd',
'/Е/u' =>
'E',
'/е/u' =>
'e',
117 '/Ж/u' =>
'J',
'/ж/u' =>
'j',
'/З/u' =>
'Z',
'/з/u' =>
'z',
118 '/И/u' =>
'Ï',
'/и/u' =>
'ï',
'/Й/u' =>
'Ý',
'/й/u' =>
'ý',
119 '/К/u' =>
'K',
'/к/u' =>
'k',
'/Қ/u' =>
'Q',
'/қ/u' =>
'q',
120 '/Л/u' =>
'L',
'/л/u' =>
'l',
'/М/u' =>
'M',
'/м/u' =>
'm',
121 '/Н/u' =>
'N',
'/н/u' =>
'n',
'/Ң/u' =>
'Ñ',
'/ң/u' =>
'ñ',
122 '/О/u' =>
'O',
'/о/u' =>
'o',
'/Ө/u' =>
'Ö',
'/ө/u' =>
'ö',
123 '/П/u' =>
'P',
'/п/u' =>
'p',
'/Р/u' =>
'R',
'/р/u' =>
'r',
124 '/С/u' =>
'S',
'/с/u' =>
's',
'/Т/u' =>
'T',
'/т/u' =>
't',
125 '/У/u' =>
'W',
'/у/u' =>
'w',
'/Ұ/u' =>
'U',
'/ұ/u' =>
'u',
126 '/Ү/u' =>
'Ü',
'/ү/u' =>
'ü',
'/Ф/u' =>
'F',
'/ф/u' =>
'f',
127 '/Х/u' =>
'X',
'/х/u' =>
'x',
'/Һ/u' =>
'H',
'/һ/u' =>
'h',
128 '/Ц/u' =>
'C',
'/ц/u' =>
'c',
'/Ч/u' =>
'Ç',
'/ч/u' =>
'ç',
129 '/Ш/u' =>
'Ş',
'/ш/u' =>
'ş',
'/Ы/u' =>
'I',
'/ы/u' =>
'ı',
130 '/І/u' =>
'İ',
'/і/u' =>
'i',
'/Э/u' =>
'É',
'/э/u' =>
'é',
133 $this->mLatn2Cyrl = [
137 '/ŞÇʹ/u' =>
'ЩЬ',
'/Şçʹ/u' =>
'Щь',
138 '/Ş[Çç]/u' =>
'Щ',
'/şç/u' =>
'щ',
139 # # soft and hard signs
141 '/ʺ([' .
KK_L_LC .
'])/u' =>
'ъ$1',
143 '/ʹ([' .
KK_L_LC .
'])/u' =>
'ь$1',
147 '/Y[Ee]/u' =>
'Е',
'/ye/u' =>
'е',
148 '/Y[Oo]/u' =>
'Ё',
'/yo/u' =>
'ё',
149 '/Y[UWuw]/u' =>
'Ю',
'/y[uw]/u' =>
'ю',
150 '/Y[Aa]/u' =>
'Я',
'/ya/u' =>
'я',
152 '/A/u' =>
'А',
'/a/u' =>
'а',
'/Ä/u' =>
'Ә',
'/ä/u' =>
'ә',
153 '/B/u' =>
'Б',
'/b/u' =>
'б',
'/C/u' =>
'Ц',
'/c/u' =>
'ц',
154 '/Ç/u' =>
'Ч',
'/ç/u' =>
'ч',
'/D/u' =>
'Д',
'/d/u' =>
'д',
155 '/E/u' =>
'Е',
'/e/u' =>
'е',
'/É/u' =>
'Э',
'/é/u' =>
'э',
156 '/F/u' =>
'Ф',
'/f/u' =>
'ф',
'/G/u' =>
'Г',
'/g/u' =>
'г',
157 '/Ğ/u' =>
'Ғ',
'/ğ/u' =>
'ғ',
'/H/u' =>
'Һ',
'/h/u' =>
'һ',
158 '/I/u' =>
'Ы',
'/ı/u' =>
'ы',
'/İ/u' =>
'І',
'/i/u' =>
'і',
159 '/Ï/u' =>
'И',
'/ï/u' =>
'и',
'/J/u' =>
'Ж',
'/j/u' =>
'ж',
160 '/K/u' =>
'К',
'/k/u' =>
'к',
'/L/u' =>
'Л',
'/l/u' =>
'л',
161 '/M/u' =>
'М',
'/m/u' =>
'м',
'/N/u' =>
'Н',
'/n/u' =>
'н',
162 '/Ñ/u' =>
'Ң',
'/ñ/u' =>
'ң',
'/O/u' =>
'О',
'/o/u' =>
'о',
163 '/Ö/u' =>
'Ө',
'/ö/u' =>
'ө',
'/P/u' =>
'П',
'/p/u' =>
'п',
164 '/Q/u' =>
'Қ',
'/q/u' =>
'қ',
'/R/u' =>
'Р',
'/r/u' =>
'р',
165 '/S/u' =>
'С',
'/s/u' =>
'с',
'/Ş/u' =>
'Ш',
'/ş/u' =>
'ш',
166 '/T/u' =>
'Т',
'/t/u' =>
'т',
'/U/u' =>
'Ұ',
'/u/u' =>
'ұ',
167 '/Ü/u' =>
'Ү',
'/ü/u' =>
'ү',
'/V/u' =>
'В',
'/v/u' =>
'в',
168 '/W/u' =>
'У',
'/w/u' =>
'у',
'/Ý/u' =>
'Й',
'/ý/u' =>
'й',
169 '/X/u' =>
'Х',
'/x/u' =>
'х',
'/Z/u' =>
'З',
'/z/u' =>
'з',
172 $this->mCyLa2Arab = [
173 # # Punctuation -> Arabic
174 '/#|№|No\./u' =>
'', # U+0600
175 '/\,/' =>
'،', # U+060C
176 '/;/' =>
'؛', # U+061B
177 '/\?/' =>
'؟', # U+061F
178 '/%/' =>
'٪', # U+066A
179 '/\*/' =>
'٭', # U+066D
181 '/0/' =>
'۰', # U+06F0
182 '/1/' =>
'۱', # U+06F1
183 '/2/' =>
'۲', # U+06F2
184 '/3/' =>
'۳', # U+06F3
185 '/4/' =>
'۴', # U+06F4
186 '/5/' =>
'۵', # U+06F5
187 '/6/' =>
'۶', # U+06F6
188 '/7/' =>
'۷', # U+06F7
189 '/8/' =>
'۸', # U+06F8
190 '/9/' =>
'۹', # U+06F9
191 # # Cyrillic -> Arabic
193 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1يە',
194 '/[еэ]/ui' =>
'ە',
'/[ъь]/ui' =>
'',
195 '/[аә]/ui' =>
'ا',
'/[оө]/ui' =>
'و',
'/[ұү]/ui' =>
'ۇ',
'/[ыі]/ui' =>
'ى',
196 '/[и]/ui' =>
'ىي',
'/ё/ui' =>
'يو',
'/ю/ui' =>
'يۋ',
'/я/ui' =>
'يا',
'/[й]/ui' =>
'ي',
197 '/ц/ui' =>
'تس',
'/щ/ui' =>
'شش',
198 '/һ/ui' =>
'ح',
'/ч/ui' =>
'تش',
199 # '/һ/ui' => 'ھ', '/ч/ui' => 'چ',
200 '/б/ui' =>
'ب',
'/в/ui' =>
'ۆ',
'/г/ui' =>
'گ',
'/ғ/ui' =>
'ع',
201 '/д/ui' =>
'د',
'/ж/ui' =>
'ج',
'/з/ui' =>
'ز',
'/к/ui' =>
'ك',
202 '/қ/ui' =>
'ق',
'/л/ui' =>
'ل',
'/м/ui' =>
'م',
'/н/ui' =>
'ن',
203 '/ң/ui' =>
'ڭ',
'/п/ui' =>
'پ',
'/р/ui' =>
'ر',
'/с/ui' =>
'س',
204 '/т/ui' =>
'ت',
'/у/ui' =>
'ۋ',
'/ф/ui' =>
'ف',
'/х/ui' =>
'ح',
232 $text = parent::translate( $text, $toVariant );
234 switch ( $toVariant ) {
251 $varsfix =
'\$[0-9]';
254 '/' . $varsfix .
'[^' . $letters .
']+/u',
257 PREG_SPLIT_OFFSET_CAPTURE
264 $ret .= substr( $text, $mstart, $m[1] - $mstart );
266 $mstart = $m[1] + strlen( $m[0] );
282 switch ( $toVariant ) {
287 $excludes =
'еэгғкқЕЭГҒКҚ';
289 $matches = preg_split(
'/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
293 $ret .= substr( $text, $mstart, $m[1] - $mstart );
297 if ( preg_match(
'/[' . $front .
']/u', $m[0] ) &&
298 !preg_match(
'/[' . $excludes .
']/u', $m[0] )
300 $ret .= preg_replace(
'/[' . $letters .
']+/u',
H_HAMZA .
'$0', $m[0] );
304 $mstart = $m[1] + strlen( $m[0] );
307 foreach ( $this->mCyLa2Arab as $pat => $rep ) {
308 $text = preg_replace( $pat, $rep, $text );
313 foreach ( $this->mCyrl2Latn as $pat => $rep ) {
314 $text = preg_replace( $pat, $rep, $text );
319 foreach ( $this->mLatn2Cyrl as $pat => $rep ) {
320 $text = preg_replace( $pat, $rep, $text );
Kazakh (Қазақша) converter routines.
convertCategoryKey( $key)
postLoadTables()
Hook for post processing after conversion tables are loaded.
loadDefaultTables()
Load default conversion tables.
regsConverter( $text, $toVariant)
translate( $text, $toVariant)
It translates text into variant.
A class that extends LanguageConverter with specific behaviour.
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
Wrapper around strtr() that holds replacements.