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
49 $variantfallbacks = [],
51 parent::__construct( $langobj, $maincode,
52 $variants, $variantfallbacks, $flags );
83 $this->mTables[
'kk-kz']->merge( $this->mTables[
'kk-cyrl'] );
84 $this->mTables[
'kk-tr']->merge( $this->mTables[
'kk-latn'] );
85 $this->mTables[
'kk-cn']->merge( $this->mTables[
'kk-arab'] );
93 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])Е/u' =>
'$1YE',
94 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1ye',
96 '/^Ё([' .
KK_C_UC .
']|$)/u' =>
'YO$1',
'/^Ё([' .
KK_C_LC .
']|$)/u' =>
'Yo$1',
97 '/^Ю([' .
KK_C_UC .
']|$)/u' =>
'YU$1',
'/^Ю([' .
KK_C_LC .
']|$)/u' =>
'Yu$1',
98 '/^Я([' .
KK_C_UC .
']|$)/u' =>
'YA$1',
'/^Я([' .
KK_C_LC .
']|$)/u' =>
'Ya$1',
99 '/^Щ([' .
KK_C_UC .
']|$)/u' =>
'ŞÇ$1',
'/^Щ([' .
KK_C_LC .
']|$)/u' =>
'Şç$1',
101 '/Ё/u' =>
'YO',
'/ё/u' =>
'yo',
102 '/Ю/u' =>
'YU',
'/ю/u' =>
'yu',
103 '/Я/u' =>
'YA',
'/я/u' =>
'ya',
104 '/Щ/u' =>
'ŞÇ',
'/щ/u' =>
'şç',
105 # # soft and hard signs
106 '/[ъЪ]/u' =>
'ʺ',
'/[ьЬ]/u' =>
'ʹ',
108 '/А/u' =>
'A',
'/а/u' =>
'a',
'/Ә/u' =>
'Ä',
'/ә/u' =>
'ä',
109 '/Б/u' =>
'B',
'/б/u' =>
'b',
'/В/u' =>
'V',
'/в/u' =>
'v',
110 '/Г/u' =>
'G',
'/г/u' =>
'g',
'/Ғ/u' =>
'Ğ',
'/ғ/u' =>
'ğ',
111 '/Д/u' =>
'D',
'/д/u' =>
'd',
'/Е/u' =>
'E',
'/е/u' =>
'e',
112 '/Ж/u' =>
'J',
'/ж/u' =>
'j',
'/З/u' =>
'Z',
'/з/u' =>
'z',
113 '/И/u' =>
'Ï',
'/и/u' =>
'ï',
'/Й/u' =>
'Ý',
'/й/u' =>
'ý',
114 '/К/u' =>
'K',
'/к/u' =>
'k',
'/Қ/u' =>
'Q',
'/қ/u' =>
'q',
115 '/Л/u' =>
'L',
'/л/u' =>
'l',
'/М/u' =>
'M',
'/м/u' =>
'm',
116 '/Н/u' =>
'N',
'/н/u' =>
'n',
'/Ң/u' =>
'Ñ',
'/ң/u' =>
'ñ',
117 '/О/u' =>
'O',
'/о/u' =>
'o',
'/Ө/u' =>
'Ö',
'/ө/u' =>
'ö',
118 '/П/u' =>
'P',
'/п/u' =>
'p',
'/Р/u' =>
'R',
'/р/u' =>
'r',
119 '/С/u' =>
'S',
'/с/u' =>
's',
'/Т/u' =>
'T',
'/т/u' =>
't',
120 '/У/u' =>
'W',
'/у/u' =>
'w',
'/Ұ/u' =>
'U',
'/ұ/u' =>
'u',
121 '/Ү/u' =>
'Ü',
'/ү/u' =>
'ü',
'/Ф/u' =>
'F',
'/ф/u' =>
'f',
122 '/Х/u' =>
'X',
'/х/u' =>
'x',
'/Һ/u' =>
'H',
'/һ/u' =>
'h',
123 '/Ц/u' =>
'C',
'/ц/u' =>
'c',
'/Ч/u' =>
'Ç',
'/ч/u' =>
'ç',
124 '/Ш/u' =>
'Ş',
'/ш/u' =>
'ş',
'/Ы/u' =>
'I',
'/ы/u' =>
'ı',
125 '/І/u' =>
'İ',
'/і/u' =>
'i',
'/Э/u' =>
'É',
'/э/u' =>
'é',
128 $this->mLatn2Cyrl = [
132 '/ŞÇʹ/u' =>
'ЩЬ',
'/Şçʹ/u' =>
'Щь',
133 '/Ş[Çç]/u' =>
'Щ',
'/şç/u' =>
'щ',
134 # # soft and hard signs
136 '/ʺ([' .
KK_L_LC .
'])/u' =>
'ъ$1',
138 '/ʹ([' .
KK_L_LC .
'])/u' =>
'ь$1',
142 '/Y[Ee]/u' =>
'Е',
'/ye/u' =>
'е',
143 '/Y[Oo]/u' =>
'Ё',
'/yo/u' =>
'ё',
144 '/Y[UWuw]/u' =>
'Ю',
'/y[uw]/u' =>
'ю',
145 '/Y[Aa]/u' =>
'Я',
'/ya/u' =>
'я',
147 '/A/u' =>
'А',
'/a/u' =>
'а',
'/Ä/u' =>
'Ә',
'/ä/u' =>
'ә',
148 '/B/u' =>
'Б',
'/b/u' =>
'б',
'/C/u' =>
'Ц',
'/c/u' =>
'ц',
149 '/Ç/u' =>
'Ч',
'/ç/u' =>
'ч',
'/D/u' =>
'Д',
'/d/u' =>
'д',
150 '/E/u' =>
'Е',
'/e/u' =>
'е',
'/É/u' =>
'Э',
'/é/u' =>
'э',
151 '/F/u' =>
'Ф',
'/f/u' =>
'ф',
'/G/u' =>
'Г',
'/g/u' =>
'г',
152 '/Ğ/u' =>
'Ғ',
'/ğ/u' =>
'ғ',
'/H/u' =>
'Һ',
'/h/u' =>
'һ',
153 '/I/u' =>
'Ы',
'/ı/u' =>
'ы',
'/İ/u' =>
'І',
'/i/u' =>
'і',
154 '/Ï/u' =>
'И',
'/ï/u' =>
'и',
'/J/u' =>
'Ж',
'/j/u' =>
'ж',
155 '/K/u' =>
'К',
'/k/u' =>
'к',
'/L/u' =>
'Л',
'/l/u' =>
'л',
156 '/M/u' =>
'М',
'/m/u' =>
'м',
'/N/u' =>
'Н',
'/n/u' =>
'н',
157 '/Ñ/u' =>
'Ң',
'/ñ/u' =>
'ң',
'/O/u' =>
'О',
'/o/u' =>
'о',
158 '/Ö/u' =>
'Ө',
'/ö/u' =>
'ө',
'/P/u' =>
'П',
'/p/u' =>
'п',
159 '/Q/u' =>
'Қ',
'/q/u' =>
'қ',
'/R/u' =>
'Р',
'/r/u' =>
'р',
160 '/S/u' =>
'С',
'/s/u' =>
'с',
'/Ş/u' =>
'Ш',
'/ş/u' =>
'ш',
161 '/T/u' =>
'Т',
'/t/u' =>
'т',
'/U/u' =>
'Ұ',
'/u/u' =>
'ұ',
162 '/Ü/u' =>
'Ү',
'/ü/u' =>
'ү',
'/V/u' =>
'В',
'/v/u' =>
'в',
163 '/W/u' =>
'У',
'/w/u' =>
'у',
'/Ý/u' =>
'Й',
'/ý/u' =>
'й',
164 '/X/u' =>
'Х',
'/x/u' =>
'х',
'/Z/u' =>
'З',
'/z/u' =>
'з',
167 $this->mCyLa2Arab = [
168 # # Punctuation -> Arabic
169 '/#|№|No\./u' =>
'', # ؀
170 '/\,/' =>
'،', # ،
171 '/;/' =>
'؛', # ؛
172 '/\?/' =>
'؟', # ؟
173 '/%/' =>
'٪', # ٪
174 '/\*/' =>
'٭', # ٭
176 '/0/' =>
'۰', # ۰
177 '/1/' =>
'۱', # ۱
178 '/2/' =>
'۲', # ۲
179 '/3/' =>
'۳', # ۳
180 '/4/' =>
'۴', # ۴
181 '/5/' =>
'۵', # ۵
182 '/6/' =>
'۶', # ۶
183 '/7/' =>
'۷', # ۷
184 '/8/' =>
'۸', # ۸
185 '/9/' =>
'۹', # ۹
186 # # Cyrillic -> Arabic
188 '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' =>
'$1يە',
189 '/[еэ]/ui' =>
'ە',
'/[ъь]/ui' =>
'',
190 '/[аә]/ui' =>
'ا',
'/[оө]/ui' =>
'و',
'/[ұү]/ui' =>
'ۇ',
'/[ыі]/ui' =>
'ى',
191 '/[и]/ui' =>
'ىي',
'/ё/ui' =>
'يو',
'/ю/ui' =>
'يۋ',
'/я/ui' =>
'يا',
'/[й]/ui' =>
'ي',
192 '/ц/ui' =>
'تس',
'/щ/ui' =>
'شش',
193 '/һ/ui' =>
'ح',
'/ч/ui' =>
'تش',
194 # '/һ/ui' => 'ھ', '/ч/ui' => 'چ',
195 '/б/ui' =>
'ب',
'/в/ui' =>
'ۆ',
'/г/ui' =>
'گ',
'/ғ/ui' =>
'ع',
196 '/д/ui' =>
'د',
'/ж/ui' =>
'ج',
'/з/ui' =>
'ز',
'/к/ui' =>
'ك',
197 '/қ/ui' =>
'ق',
'/л/ui' =>
'ل',
'/м/ui' =>
'م',
'/н/ui' =>
'ن',
198 '/ң/ui' =>
'ڭ',
'/п/ui' =>
'پ',
'/р/ui' =>
'ر',
'/с/ui' =>
'س',
199 '/т/ui' =>
'ت',
'/у/ui' =>
'ۋ',
'/ф/ui' =>
'ف',
'/х/ui' =>
'ح',
230 if ( is_object( $nt ) ) {
231 $ns = $nt->getNamespace();
238 parent::findVariantLink(
$link, $nt, $ignoreOtherCond );
253 $text = parent::translate( $text, $toVariant );
255 switch ( $toVariant ) {
272 $varsfix =
'\$[0-9]';
275 '/' . $varsfix .
'[^' . $letters .
']+/u',
278 PREG_SPLIT_OFFSET_CAPTURE
285 $ret .= substr( $text, $mstart, $m[1] - $mstart );
287 $mstart = $m[1] + strlen( $m[0] );
303 switch ( $toVariant ) {
308 $excludes =
'еэгғкқЕЭГҒКҚ';
310 $matches = preg_split(
'/[\b\s\-\.:]+/', $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
314 $ret .= substr( $text, $mstart, $m[1] - $mstart );
318 if ( preg_match(
'/[' . $front .
']/u', $m[0] )
319 && !preg_match(
'/[' . $excludes .
']/u', $m[0] )
321 $ret .= preg_replace(
'/[' . $letters .
']+/u',
H_HAMZA .
'$0', $m[0] );
325 $mstart = $m[1] + strlen( $m[0] );
328 foreach ( $this->mCyLa2Arab as $pat => $rep ) {
329 $text = preg_replace( $pat, $rep, $text );
335 foreach ( $this->mCyrl2Latn as $pat => $rep ) {
336 $text = preg_replace( $pat, $rep, $text );
342 foreach ( $this->mLatn2Cyrl as $pat => $rep ) {
343 $text = preg_replace( $pat, $rep, $text );
369 parent::__construct();
371 $variants = [
'kk',
'kk-cyrl',
'kk-latn',
'kk-arab',
'kk-kz',
'kk-tr',
'kk-cn' ];
372 $variantfallbacks = [
377 'kk-kz' =>
'kk-cyrl',
378 'kk-tr' =>
'kk-latn',
382 $this->mConverter =
new KkConverter( $this,
'kk', $variants, $variantfallbacks );
393 if ( substr( $string, 0, 1 ) ===
'i' ) {
395 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
396 return 'İ' . substr( $string, 1 );
399 return parent::ucfirst( $string );
410 if ( substr( $string, 0, 1 ) ===
'I' ) {
412 if ( $variant ==
'kk-latn' || $variant ==
'kk-tr' ) {
413 return 'ı' . substr( $string, 1 );
416 return parent::lcfirst( $string );
426 switch ( $variant ) {
429 $word = parent::convertGrammarKk_arab( $word, $case );
433 $word = parent::convertGrammarKk_latn( $word, $case );
439 $word = parent::convertGrammarKk_cyrl( $word, $case );
Kazakh (Қазақша) converter routines.
convertCategoryKey( $key)
postLoadTables()
Hook for post processing after conversion tables are loaded.
loadDefaultTables()
Load default conversion tables.
regsConverter( $text, $toVariant)
__construct( $langobj, $maincode, $variants=[], $variantfallbacks=[], $flags=[])
translate( $text, $toVariant)
It translates text into variant.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Base class for language conversion.
getPreferredVariant()
Get preferred language variant.
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
class that handles Cyrillic, Latin and Arabic scripts for Kazakh right now it only distinguish kk_cyr...
convertGrammar( $word, $case)
lcfirst( $string)
It fixes issue with lcfirst for transforming 'I' to 'ı'.
ucfirst( $string)
It fixes issue with ucfirst for transforming 'i' to 'İ'.
Wrapper around strtr() that holds replacements.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
usually copyright or history_copyright This message must be in HTML not wikitext & $link