Debian Codegraph @

includes/language/converters/TgConverter.php

raw symbols SCIP
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21 /**
22 * Tajik (Тоҷикӣ) specific code, converting Tajiki to Latin orthography.
23 *
24 * @ingroup Languages
25 */
26 class TgConverter extends LanguageConverter {
27
28 private const TABLE = [
29 'а' => 'a',
30 'б' => 'b',
31 'в' => 'v',
32 'г' => 'g',
33 'д' => 'd',
34 'е' => 'e',
35 'ё' => 'jo',
36 'ж' => 'ƶ',
37 'з' => 'z',
38 'ии ' => 'iji ',
39 'и' => 'i',
40 'й' => 'j',
41 'к' => 'k',
42 'л' => 'l',
43 'м' => 'm',
44 'н' => 'n',
45 'о' => 'o',
46 'п' => 'p',
47 'р' => 'r',
48 'с' => 's',
49 'т' => 't',
50 'у' => 'u',
51 'ф' => 'f',
52 'х' => 'x',
53 'ч' => 'c',
54 'ш' => 'ş',
55 'ъ' => '\'',
56 'э' => 'e',
57 'ю' => 'ju',
58 'я' => 'ja',
59 'ғ' => 'ƣ',
60 'ӣ' => 'ī',
61 'қ' => 'q',
62 'ӯ' => 'ū',
63 'ҳ' => 'h',
64 'ҷ' => 'ç',
65 'ц' => 'ts',
66 'А' => 'A',
67 'Б' => 'B',
68 'В' => 'V',
69 'Г' => 'G',
70 'Д' => 'D',
71 'Е' => 'E',
72 'Ё' => 'Jo',
73 'Ж' => 'Ƶ',
74 'З' => 'Z',
75 'И' => 'I',
76 'Й' => 'J',
77 'К' => 'K',
78 'Л' => 'L',
79 'М' => 'M',
80 'Н' => 'N',
81 'О' => 'O',
82 'П' => 'P',
83 'Р' => 'R',
84 'С' => 'S',
85 'Т' => 'T',
86 'У' => 'U',
87 'Ф' => 'F',
88 'Х' => 'X',
89 'Ч' => 'C',
90 'Ш' => 'Ş',
91 'Ъ' => '\'',
92 'Э' => 'E',
93 'Ю' => 'Ju',
94 'Я' => 'Ja',
95 'Ғ' => 'Ƣ',
96 'Ӣ' => 'Ī',
97 'Қ' => 'Q',
98 'Ӯ' => 'Ū',
99 'Ҳ' => 'H',
100 'Ҷ' => 'Ç',
101 'Ц' => 'Ts',
102 ];
103
104 public function getMainCode(): string {
105 return 'tg';
106 }
107
108 public function getLanguageVariants(): array {
109 return [ 'tg', 'tg-latn' ];
110 }
111
112 public function getVariantsFallbacks(): array {
113 return [];
114 }
115
116 protected function loadDefaultTables(): array {
117 return [
118 'tg-latn' => new ReplacementArray( self::TABLE ),
119 'tg' => new ReplacementArray()
120 ];
121 }
122 }