MediaWiki REL1_33
LanguageCrhTest.php
Go to the documentation of this file.
1<?php
2
17 public function testAutoConvertToAllVariantsByWord( $cyrl, $lat ) {
18 $value = $lat;
19 $result = [
20 'crh' => $value,
21 'crh-cyrl' => $cyrl,
22 'crh-latn' => $lat,
23 ];
24 $this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
25
26 $value = $cyrl;
27 $result = [
28 'crh' => $value,
29 'crh-cyrl' => $cyrl,
30 'crh-latn' => $lat,
31 ];
32 $this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
33
34 $value = $cyrl . ' ' . $lat;
35 $result = [
36 'crh' => $value,
37 'crh-cyrl' => $cyrl . ' ' . $cyrl,
38 'crh-latn' => $lat . ' ' . $lat,
39 ];
40 $this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
41
42 $value = $lat . ' ' . $cyrl;
43 $result = [
44 'crh' => $value,
45 'crh-cyrl' => $cyrl . ' ' . $cyrl,
46 'crh-latn' => $lat . ' ' . $lat,
47 ];
48 $this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
49 }
50
51 public static function provideAutoConvertToAllVariantsByWord() {
52 return [
53 // general words, covering more of the alphabet
54 [ 'рузгярнынъ', 'ruzgârnıñ' ], [ 'Париж', 'Parij' ], [ 'чёкюч', 'çöküç' ],
55 [ 'элифбени', 'elifbeni' ], [ 'полициясы', 'politsiyası' ], [ 'хусусында', 'hususında' ],
56 [ 'акъшамларны', 'aqşamlarnı' ], [ 'опькеленюв', 'öpkelenüv' ],
57 [ 'кулюмсиреди', 'külümsiredi' ], [ 'айтмайджагъым', 'aytmaycağım' ],
58 [ 'козьяшсыз', 'közyaşsız' ],
59
60 // exception words
61 [ 'инструменталь', 'instrumental' ], [ 'гургуль', 'gürgül' ], [ 'тюшюнмемек', 'tüşünmemek' ],
62
63 // specific problem words
64 [ 'куню', 'künü' ], [ 'сюргюнлиги', 'sürgünligi' ], [ 'озю', 'özü' ], [ 'этти', 'etti' ],
65 [ 'эсас', 'esas' ], [ 'дёрт', 'dört' ], [ 'кельди', 'keldi' ], [ 'км²', 'km²' ],
66 [ 'юзь', 'yüz' ], [ 'АКъШ', 'AQŞ' ], [ 'ШСДжБнен', 'ŞSCBnen' ], [ 'июль', 'iyül' ],
67 [ 'ишгъаль', 'işğal' ], [ 'ишгъальджилерине', 'işğalcilerine' ], [ 'район', 'rayon' ],
68 [ 'районынынъ', 'rayonınıñ' ], [ 'Ногъай', 'Noğay' ], [ 'Юрьтю', 'Yürtü' ],
69 [ 'ватандан', 'vatandan' ], [ 'ком-кок', 'köm-kök' ], [ 'АКЪКЪЫ', 'AQQI' ],
70 [ 'ДАГЪГЪА', 'DAĞĞA' ], [ '13-юнджи', '13-ünci' ], [ 'ДЖУРЬМЕК', 'CÜRMEK' ],
71 [ 'джумлеси', 'cümlesi' ], [ 'ильи', 'ilyi' ], [ 'Ильи', 'İlyi' ], [ 'бруцел', 'brutsel' ],
72 [ 'коцюб', 'kotsüb' ], [ 'плацен', 'platsen' ], [ 'эпицентр', 'epitsentr' ],
73
74 // -tsin- words
75 [ 'кетсин', 'ketsin' ], [ 'кирлетсин', 'kirletsin' ], [ 'этсин', 'etsin' ],
76 [ 'етсин', 'yetsin' ], [ 'этсинлерми', 'etsinlermi' ], [ 'принцини', 'printsini' ],
77 [ 'медицина', 'meditsina' ], [ 'Щетсин', 'Şçetsin' ], [ 'Щекоцины', 'Şçekotsinı' ],
78
79 // regex pattern words
80 [ 'коюнден', 'köyünden' ], [ 'аньге', 'ange' ],
81
82 // multi part words
83 [ 'эки юз', 'eki yüz' ],
84
85 // affix patterns
86 [ 'койнинъ', 'köyniñ' ], [ 'Авджыкойде', 'Avcıköyde' ], [ 'экваториаль', 'ekvatorial' ],
87 [ 'Джанкой', 'Canköy' ], [ 'усть', 'üst' ], [ 'роль', 'rol' ], [ 'буюк', 'büyük' ],
88 [ 'джонк', 'cönk' ],
89
90 // Roman numerals vs Initials, part 1 - Roman numeral initials without spaces
91 [ 'А.Б.Дж.Д.М. Къадырова XII', 'A.B.C.D.M. Qadırova XII' ],
92 // Roman numerals vs Initials, part 2 - Roman numeral initials with spaces
93 [ 'Г. Х. Ы. В. X. Л. Меметов III', 'G. H. I. V. X. L. Memetov III' ],
94
95 // ALL CAPS, made up acronyms
96 [ 'НЪАБ', 'ÑAB' ], [ 'КЪЫДЖ', 'QIC' ], [ 'ГЪУК', 'ĞUK' ], [ 'ДЖОТ', 'COT' ], [ 'ДЖА', 'CA' ],
97 ];
98 }
99
107 public function testAutoConvertToAllVariantsByString( $result, $value ) {
108 $this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
109 }
110
112 return [
113 [ // Roman numerals and quotes, esp. single-letter Roman numerals at the end of a string
114 [
115 'crh' => 'VI,VII IX “dört” «дёрт» XI XII I V X L C D M',
116 'crh-cyrl' => 'VI,VII IX «дёрт» «дёрт» XI XII I V X L C D M',
117 'crh-latn' => 'VI,VII IX “dört” "dört" XI XII I V X L C D M',
118 ],
119 'VI,VII IX “dört” «дёрт» XI XII I V X L C D M'
120 ],
121 [ // Many-to-one mappings: many Cyrillic to one Latin
122 [
123 'crh' => 'шофер шофёр şoför корбекул корьбекул корьбекуль körbekül',
124 'crh-cyrl' => 'шофер шофёр шофёр корбекул корьбекул корьбекуль корьбекуль',
125 'crh-latn' => 'şoför şoför şoför körbekül körbekül körbekül körbekül',
126 ],
127 'шофер шофёр şoför корбекул корьбекул корьбекуль körbekül'
128 ],
129 [ // Many-to-one mappings: many Latin to one Cyrillic
130 [
131 'crh' => 'fevqülade fevqulade февкъульаде beyude beyüde бейуде',
132 'crh-cyrl' => 'февкъульаде февкъульаде февкъульаде бейуде бейуде бейуде',
133 'crh-latn' => 'fevqülade fevqulade fevqulade beyude beyüde beyüde',
134 ],
135 'fevqülade fevqulade февкъульаде beyude beyüde бейуде'
136 ],
137 ];
138 }
139}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Helping class to run tests using a clean language instance.
LanguageCrh CrhConverter MediaWiki\Languages\Data\CrhExceptions.
static provideAutoConvertToAllVariantsByString()
testAutoConvertToAllVariantsByString( $result, $value)
provideAutoConvertToAllVariantsByString Language::autoConvertToAllVariants
testAutoConvertToAllVariantsByWord( $cyrl, $lat)
provideAutoConvertToAllVariantsByWord Language::autoConvertToAllVariants
static provideAutoConvertToAllVariantsByWord()