* @param array $variantfallbacks
* @param array $flags
*/
- function __construct( $langobj, $maincode,
- $variants = [],
- $variantfallbacks = [],
- $flags = [] ) {
+ function __construct( Language $langobj, $maincode,
+ $variants = [],
+ $variantfallbacks = [],
+ $flags = []
+ ) {
parent::__construct( $langobj, $maincode,
$variants, $variantfallbacks, $flags );
$this->mCyLa2Arab = [
# # Punctuation -> Arabic
- '/#|№|No\./u' => '', # ؀
- '/\,/' => '،', # ،
- '/;/' => '؛', # ؛
- '/\?/' => '؟', # ؟
- '/%/' => '٪', # ٪
- '/\*/' => '٭', # ٭
+ '/#|№|No\./u' => '', # U+0600
+ '/\,/' => '،', # U+060C
+ '/;/' => '؛', # U+061B
+ '/\?/' => '؟', # U+061F
+ '/%/' => '٪', # U+066A
+ '/\*/' => '٭', # U+066D
# # Digits -> Arabic
- '/0/' => '۰', # ۰
- '/1/' => '۱', # ۱
- '/2/' => '۲', # ۲
- '/3/' => '۳', # ۳
- '/4/' => '۴', # ۴
- '/5/' => '۵', # ۵
- '/6/' => '۶', # ۶
- '/7/' => '۷', # ۷
- '/8/' => '۸', # ۸
- '/9/' => '۹', # ۹
+ '/0/' => '۰', # U+06F0
+ '/1/' => '۱', # U+06F1
+ '/2/' => '۲', # U+06F2
+ '/3/' => '۳', # U+06F3
+ '/4/' => '۴', # U+06F4
+ '/5/' => '۵', # U+06F5
+ '/6/' => '۶', # U+06F6
+ '/7/' => '۷', # U+06F7
+ '/8/' => '۸', # U+06F8
+ '/9/' => '۹', # U+06F9
# # Cyrillic -> Arabic
'/Аллаһ/ui' => 'ﷲ',
'/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1يە',
$ret = '';
foreach ( $matches as $m ) {
- $ret .= substr( $text, $mstart, $m[1] -$mstart );
+ $ret .= substr( $text, $mstart, $m[1] - $mstart );
$ret .= $this->regsConverter( $m[0], $toVariant );
$mstart = $m[1] + strlen( $m[0] );
}
// is matched the word to front vowels?
// exclude a words matched to е, э, г, к, к, қ,
// them should be without hamza
- if ( preg_match( '/[' . $front . ']/u', $m[0] )
- && !preg_match( '/[' . $excludes . ']/u', $m[0] )
+ if ( preg_match( '/[' . $front . ']/u', $m[0] ) &&
+ !preg_match( '/[' . $excludes . ']/u', $m[0] )
) {
$ret .= preg_replace( '/[' . $letters . ']+/u', H_HAMZA . '$0', $m[0] );
} else {
$text = preg_replace( $pat, $rep, $text );
}
return $text;
- break;
case 'kk-latn':
case 'kk-tr':
foreach ( $this->mCyrl2Latn as $pat => $rep ) {
$text = preg_replace( $pat, $rep, $text );
}
return $text;
- break;
case 'kk-cyrl':
case 'kk-kz':
foreach ( $this->mLatn2Cyrl as $pat => $rep ) {
$text = preg_replace( $pat, $rep, $text );
}
return $text;
- break;
default:
return $text;
}