LotinKrillYangiLotin 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- LotinKrillYangiLotin-1.0.0/LotinKrillYangiLotin/LotinKrillYangilotin.py +421 -0
- LotinKrillYangiLotin-1.0.0/LotinKrillYangiLotin/__init__.py +10 -0
- LotinKrillYangiLotin-1.0.0/LotinKrillYangiLotin.egg-info/PKG-INFO +14 -0
- LotinKrillYangiLotin-1.0.0/LotinKrillYangiLotin.egg-info/SOURCES.txt +8 -0
- LotinKrillYangiLotin-1.0.0/LotinKrillYangiLotin.egg-info/dependency_links.txt +1 -0
- LotinKrillYangiLotin-1.0.0/LotinKrillYangiLotin.egg-info/top_level.txt +1 -0
- LotinKrillYangiLotin-1.0.0/PKG-INFO +14 -0
- LotinKrillYangiLotin-1.0.0/README.md +1 -0
- LotinKrillYangiLotin-1.0.0/setup.cfg +4 -0
- LotinKrillYangiLotin-1.0.0/setup.py +21 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Muallif: Dasturbek (github.com/ddasturbek)
|
|
3
|
+
Versiya: 1.0.0
|
|
4
|
+
|
|
5
|
+
Dasturdan o‘zbek tilidagi matnlarni yozuv shaklini almashtirishda
|
|
6
|
+
va yangi lotin alifbosini joriy qilishda foydalanish mumkin!
|
|
7
|
+
|
|
8
|
+
O‘zbek Lotin alifbosida 29 harf va bitta tutuq belgi (’) bor.
|
|
9
|
+
O‘zbek Krill alifbosida shunga mos, ya’ni 30 ta harf va belgi bor.
|
|
10
|
+
O‘zbek Yangi lotin alifbosida ham jami 30 ta harf va belgi bor.
|
|
11
|
+
|
|
12
|
+
Alifbo bilan to‘liq holda quyida tanishishingiz mumkin:
|
|
13
|
+
{rasm linki}
|
|
14
|
+
|
|
15
|
+
Yangi lotin yozuvi haqida O‘zbekiston Respublikasi Fanlar akademiyasi tomonidan 'NORMATIV-HUQUQIY HUJJATLAR LOYIHALARI MUHOKAMASI PORTALI'ga muhokamaga qo‘yilgan:
|
|
16
|
+
https://regulation.gov.uz/oz/d/31596
|
|
17
|
+
|
|
18
|
+
Harflarni almashtirishda foydalanilgan qoidalar manbalari:
|
|
19
|
+
1. https://uz.wikipedia.org/wiki/Vikipediya:O%CA%BBzbek_lotin_alifbosi_qoidalari
|
|
20
|
+
2. https://uz.wikipedia.org/wiki/Vikipediya:Imlo_va_grammatika
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Almashtirish:
|
|
26
|
+
|
|
27
|
+
def __init__(self):
|
|
28
|
+
self.__LotinAlifbo = "AaBbDdFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZz’’" # EeO‘o‘G‘g‘ShshChchNgng
|
|
29
|
+
self.__KrillAlifbo = "АаБбДдФфГгҲҳИиЖжКкЛлМмНнОоПпҚқРрСсТтУуВвХхЙйЗзЪъ" # ЕеЎўҒғШшЧчНгнг + ЭэЁёЦцЮюЯя
|
|
30
|
+
self.__YangiLotinAlifbo = "AaBbDdFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZz’’" # EeŌōḠḡŞşÇçng
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def __change_apostrophe(text):
|
|
34
|
+
# O‘o‘ va G‘g‘ harflarining belgisini almashtirish uchun funksiya
|
|
35
|
+
|
|
36
|
+
text = text.replace(f"O{chr(39)}", f"O{chr(8216)}") # ord("'") -> ord("‘")
|
|
37
|
+
text = text.replace(f"o{chr(39)}", f"o{chr(8216)}")
|
|
38
|
+
text = text.replace(f"G{chr(39)}", f"G{chr(8216)}")
|
|
39
|
+
text = text.replace(f"g{chr(39)}", f"g{chr(8216)}")
|
|
40
|
+
|
|
41
|
+
text = text.replace(f"O{chr(96)}", f"O{chr(8216)}") # ord("`") -> ord("‘")
|
|
42
|
+
text = text.replace(f"o{chr(96)}", f"o{chr(8216)}")
|
|
43
|
+
text = text.replace(f"G{chr(96)}", f"G{chr(8216)}")
|
|
44
|
+
text = text.replace(f"g{chr(96)}", f"g{chr(8216)}")
|
|
45
|
+
|
|
46
|
+
text = text.replace(f"O{chr(699)}", f"O{chr(8216)}") # ord("ʻ") -> ord("‘")
|
|
47
|
+
text = text.replace(f"o{chr(699)}", f"o{chr(8216)}")
|
|
48
|
+
text = text.replace(f"G{chr(699)}", f"G{chr(8216)}")
|
|
49
|
+
text = text.replace(f"g{chr(699)}", f"g{chr(8216)}")
|
|
50
|
+
|
|
51
|
+
text = text.replace(f"O{chr(700)}", f"O{chr(8216)}") # ord("ʼ") -> ord("‘")
|
|
52
|
+
text = text.replace(f"o{chr(700)}", f"o{chr(8216)}")
|
|
53
|
+
text = text.replace(f"G{chr(700)}", f"G{chr(8216)}")
|
|
54
|
+
text = text.replace(f"g{chr(700)}", f"g{chr(8216)}")
|
|
55
|
+
|
|
56
|
+
text = text.replace(f"O{chr(8217)}", f"O{chr(8216)}") # ord("’") -> ord("‘")
|
|
57
|
+
text = text.replace(f"o{chr(8217)}", f"o{chr(8216)}")
|
|
58
|
+
text = text.replace(f"G{chr(8217)}", f"G{chr(8216)}")
|
|
59
|
+
text = text.replace(f"g{chr(8217)}", f"g{chr(8216)}")
|
|
60
|
+
|
|
61
|
+
return text
|
|
62
|
+
|
|
63
|
+
def Lotinga(self, text): # noqa
|
|
64
|
+
|
|
65
|
+
# Krillcha Eе harfi lotinchaga quyidagicha o‘zgartiriladi.
|
|
66
|
+
# 1) So‘zning boshida yoki unlidan keyin kelsa ye shaklida: егулик - yegulik, поезд - poyezd
|
|
67
|
+
# ъ tutuq belgisidan keyin kelsa ъ olib tashlanadi va ye shaklida: подъезд - podyezd
|
|
68
|
+
# 2) Qolgan barcha holatlarda lotincha Ee shaklida o‘zgartiriladi.
|
|
69
|
+
|
|
70
|
+
# Krillchada Цц harfi lotinchaga quyidagicha o‘zgartiriladi.
|
|
71
|
+
# 1) So‘z boshida yoki undoshdan keyin kelsa s shaklida: цирк-sirk, функция-funksiya
|
|
72
|
+
# 2) So‘z o‘rtasida unlidan keyin kelsa ts shaklida: доцент-dotsent, процент-protsent
|
|
73
|
+
|
|
74
|
+
result = ""
|
|
75
|
+
text = self.__change_apostrophe(text)
|
|
76
|
+
for i in range(len(text)):
|
|
77
|
+
if i == 0 and ord(text[i]) == ord('Е'):
|
|
78
|
+
if text.isupper():
|
|
79
|
+
result += "YE"
|
|
80
|
+
else:
|
|
81
|
+
result += "Ye"
|
|
82
|
+
elif i == 0 and ord(text[i]) == ord('е'):
|
|
83
|
+
result += "ye"
|
|
84
|
+
elif i > 0 and text[i - 1] in [' ', 'А', 'E', 'И', 'О', 'У', 'Ў', 'Ъ', '-'] and ord(text[i]) == ord('Е'):
|
|
85
|
+
if text[i - 1] == 'Ъ':
|
|
86
|
+
result = result[:-1]
|
|
87
|
+
if text.isupper():
|
|
88
|
+
result += "YE"
|
|
89
|
+
else:
|
|
90
|
+
result += "Ye"
|
|
91
|
+
elif i > 0 and text[i - 1] in [' ', 'а', 'е', 'и', 'о', 'у', 'ў', 'ъ', '-'] and ord(text[i]) == ord('е'):
|
|
92
|
+
if text[i - 1] == 'ъ':
|
|
93
|
+
result = result[:-1]
|
|
94
|
+
result += "ye"
|
|
95
|
+
elif ord(text[i]) == ord('Е'):
|
|
96
|
+
result += "E"
|
|
97
|
+
elif ord(text[i]) == ord('е'):
|
|
98
|
+
result += "e"
|
|
99
|
+
elif ord(text[i]) == ord('Э'):
|
|
100
|
+
result += "E"
|
|
101
|
+
elif ord(text[i]) == ord('э'):
|
|
102
|
+
result += "e"
|
|
103
|
+
elif ord(text[i]) == ord('С'):
|
|
104
|
+
result += "S"
|
|
105
|
+
elif ord(text[i]) == ord('с'):
|
|
106
|
+
result += "s"
|
|
107
|
+
elif ord(text[i]) == ord('Ў'):
|
|
108
|
+
result += "O‘"
|
|
109
|
+
elif ord(text[i]) == ord('ў'):
|
|
110
|
+
result += "o‘"
|
|
111
|
+
elif ord(text[i]) == ord('Ғ'):
|
|
112
|
+
result += "G‘"
|
|
113
|
+
elif ord(text[i]) == ord('ғ'):
|
|
114
|
+
result += "g‘"
|
|
115
|
+
elif ord(text[i]) == ord('Ш'):
|
|
116
|
+
if text.isupper():
|
|
117
|
+
result += "SH"
|
|
118
|
+
else:
|
|
119
|
+
result += "Sh"
|
|
120
|
+
elif ord(text[i]) == ord('ш'):
|
|
121
|
+
result += "sh"
|
|
122
|
+
elif ord(text[i]) == ord('Ч'):
|
|
123
|
+
if text.isupper():
|
|
124
|
+
result += "CH"
|
|
125
|
+
else:
|
|
126
|
+
result += "Ch"
|
|
127
|
+
elif ord(text[i]) == ord('ч'):
|
|
128
|
+
result += "ch"
|
|
129
|
+
elif ord(text[i]) == ord('Ō'):
|
|
130
|
+
result += "O‘"
|
|
131
|
+
elif ord(text[i]) == ord('ō'):
|
|
132
|
+
result += "o‘"
|
|
133
|
+
elif ord(text[i]) == ord('Ḡ'):
|
|
134
|
+
result += "G‘"
|
|
135
|
+
elif ord(text[i]) == ord('ḡ'):
|
|
136
|
+
result += "g‘"
|
|
137
|
+
elif ord(text[i]) == ord('Ş'):
|
|
138
|
+
if text.isupper():
|
|
139
|
+
result += "SH"
|
|
140
|
+
else:
|
|
141
|
+
result += "Sh"
|
|
142
|
+
elif ord(text[i]) == ord('ş'):
|
|
143
|
+
result += "sh"
|
|
144
|
+
elif ord(text[i]) == ord('Ç'):
|
|
145
|
+
if text.isupper():
|
|
146
|
+
result += "CH"
|
|
147
|
+
else:
|
|
148
|
+
result += "Ch"
|
|
149
|
+
elif ord(text[i]) == ord('ç'):
|
|
150
|
+
result += "ch"
|
|
151
|
+
elif ord(text[i]) == ord('Ё'):
|
|
152
|
+
if text.isupper():
|
|
153
|
+
result += "YO"
|
|
154
|
+
else:
|
|
155
|
+
result += "Yo"
|
|
156
|
+
elif ord(text[i]) == ord('ё'):
|
|
157
|
+
result += "yo"
|
|
158
|
+
elif i > 0 and text[i - 1] in ['А', 'E', 'И', 'О', 'У', 'Ў'] and ord(text[i]) == ord('Ц'):
|
|
159
|
+
if text.isupper():
|
|
160
|
+
result += "TS"
|
|
161
|
+
else:
|
|
162
|
+
result += "Ts"
|
|
163
|
+
elif i > 0 and text[i - 1] in ['а', 'е', 'и', 'о', 'у', 'ў'] and ord(text[i]) == ord('ц'):
|
|
164
|
+
result += "ts"
|
|
165
|
+
elif ord(text[i]) == ord('Ц'):
|
|
166
|
+
result += "S"
|
|
167
|
+
elif ord(text[i]) == ord('ц'):
|
|
168
|
+
result += "s"
|
|
169
|
+
elif ord(text[i]) == ord('Ю'):
|
|
170
|
+
if text.isupper():
|
|
171
|
+
result += "YU"
|
|
172
|
+
else:
|
|
173
|
+
result += "Yu"
|
|
174
|
+
elif ord(text[i]) == ord('ю'):
|
|
175
|
+
result += "yu"
|
|
176
|
+
elif ord(text[i]) == ord('Я'):
|
|
177
|
+
if text.isupper():
|
|
178
|
+
result += "YA"
|
|
179
|
+
else:
|
|
180
|
+
result += "Ya"
|
|
181
|
+
elif ord(text[i]) == ord('я'):
|
|
182
|
+
result += "ya"
|
|
183
|
+
elif self.__KrillAlifbo.find(text[i]) + 1:
|
|
184
|
+
result += self.__LotinAlifbo[self.__KrillAlifbo.find(text[i])]
|
|
185
|
+
else:
|
|
186
|
+
result += text[i]
|
|
187
|
+
|
|
188
|
+
return result
|
|
189
|
+
|
|
190
|
+
def Krillga(self, text): # noqa
|
|
191
|
+
|
|
192
|
+
# Lotinchada Ee harfi krillchaga quyidagicha o‘zgartiriladi.
|
|
193
|
+
# 1) So‘zning boshida va unlidan keyin kelsa Ээ shaklida: elak-элак, aeraport-аэропорт
|
|
194
|
+
# 2) Undosh harfidan keyin kelsa Ее shaklida: temir-темир, kel-кел, geometriya-геометрия
|
|
195
|
+
# Yy undoshidan keyin kelsa Yy tushirib qoldirilib Ее shaklida yoziladi: yengil-енгил
|
|
196
|
+
|
|
197
|
+
result = ""
|
|
198
|
+
text = self.__change_apostrophe(text)
|
|
199
|
+
for i in range(len(text)):
|
|
200
|
+
if i == 0 and ord(text[i]) == ord('E'):
|
|
201
|
+
result += "Э"
|
|
202
|
+
elif i == 0 and ord(text[i]) == ord('e'):
|
|
203
|
+
result += "э"
|
|
204
|
+
elif i > 0 and text[i - 1] == ' ' and ord(text[i]) == ord('E'):
|
|
205
|
+
result += "Э"
|
|
206
|
+
elif i > 0 and text[i - 1] == ' ' and ord(text[i]) == ord('e'):
|
|
207
|
+
result += "э"
|
|
208
|
+
elif i > 0 and text[i - 1] in ['A', 'E', 'I', 'O', 'U'] and ord(text[i]) == ord('E'):
|
|
209
|
+
result += "Э"
|
|
210
|
+
elif i > 0 and text[i - 1] in ['a', 'e', 'i', 'o', 'u'] and ord(text[i]) == ord('e'):
|
|
211
|
+
result += "э"
|
|
212
|
+
elif i > 1 and text[i - 2] == 'O' and text[i - 1] == '‘' and ord(text[i]) == ord('E'):
|
|
213
|
+
result += "Э"
|
|
214
|
+
elif i > 1 and text[i - 2] == 'o' and text[i - 1] == '‘' and ord(text[i]) == ord('e'):
|
|
215
|
+
result += "э"
|
|
216
|
+
elif i > 0 and ord(text[i - 1]) == ord('Y') and ord(text[i]) == ord('E'):
|
|
217
|
+
result = result[:-1]
|
|
218
|
+
result += "Е"
|
|
219
|
+
elif i > 0 and ord(text[i - 1]) == ord('y') and ord(text[i]) == ord('e'):
|
|
220
|
+
result = result[:-1]
|
|
221
|
+
result += "е"
|
|
222
|
+
elif ord(text[i]) == ord('E'):
|
|
223
|
+
result += "Е"
|
|
224
|
+
elif ord(text[i]) == ord('e'):
|
|
225
|
+
result += "е"
|
|
226
|
+
elif i > 0 and text[i - 1] == 'O' and text[i] == '‘':
|
|
227
|
+
if result[len(result)-1] == 'Ё':
|
|
228
|
+
result = result[:-1]
|
|
229
|
+
result += "ЙЎ"
|
|
230
|
+
else:
|
|
231
|
+
result = result[:-1]
|
|
232
|
+
result += "Ў"
|
|
233
|
+
elif i > 0 and text[i - 1] == 'o' and text[i] == '‘':
|
|
234
|
+
if result[len(result)-1] == 'ё':
|
|
235
|
+
result = result[:-1]
|
|
236
|
+
result += "йў"
|
|
237
|
+
else:
|
|
238
|
+
result = result[:-1]
|
|
239
|
+
result += "ў"
|
|
240
|
+
elif i > 0 and text[i - 1] == 'G' and text[i] == '‘':
|
|
241
|
+
result = result[:-1]
|
|
242
|
+
result += "Ғ"
|
|
243
|
+
elif i > 0 and text[i - 1] == 'g' and text[i] == '‘':
|
|
244
|
+
result = result[:-1]
|
|
245
|
+
result += "ғ"
|
|
246
|
+
elif i > 0 and text[i - 1] == "S" and (ord(text[i]) == ord('H') or ord(text[i]) == ord('h')):
|
|
247
|
+
result = result[:-1]
|
|
248
|
+
result += "Ш"
|
|
249
|
+
elif i > 0 and text[i - 1] == "s" and ord(text[i]) == ord('h'):
|
|
250
|
+
result = result[:-1]
|
|
251
|
+
result += "ш"
|
|
252
|
+
elif i > 0 and text[i - 1] == "C" and (ord(text[i]) == ord('H') or ord(text[i]) == ord('h')):
|
|
253
|
+
result = result[:-1]
|
|
254
|
+
result += "Ч"
|
|
255
|
+
elif i > 0 and text[i - 1] == "c" and ord(text[i]) == ord('h'):
|
|
256
|
+
result = result[:-1]
|
|
257
|
+
result += "ч"
|
|
258
|
+
elif ord(text[i]) == ord('Ō'):
|
|
259
|
+
result += "Ў"
|
|
260
|
+
elif ord(text[i]) == ord('ō'):
|
|
261
|
+
result += "ў"
|
|
262
|
+
elif ord(text[i]) == ord('Ḡ'):
|
|
263
|
+
result += "Ғ"
|
|
264
|
+
elif ord(text[i]) == ord('ḡ'):
|
|
265
|
+
result += "ғ"
|
|
266
|
+
elif ord(text[i]) == ord('Ş'):
|
|
267
|
+
result += "Ш"
|
|
268
|
+
elif ord(text[i]) == ord('ş'):
|
|
269
|
+
result += "ш"
|
|
270
|
+
elif ord(text[i]) == ord('Ç'):
|
|
271
|
+
result += "Ч"
|
|
272
|
+
elif ord(text[i]) == ord('ç'):
|
|
273
|
+
result += "ч"
|
|
274
|
+
elif i > 0 and text[i - 1] == 'Y' and (ord(text[i]) == ord('O') or ord(text[i]) == ord('o')):
|
|
275
|
+
result = result[:-1]
|
|
276
|
+
result += "Ё"
|
|
277
|
+
elif i > 0 and text[i - 1] == 'y' and ord(text[i]) == ord('o'):
|
|
278
|
+
result = result[:-1]
|
|
279
|
+
result += "ё"
|
|
280
|
+
elif i > 0 and text[i-1] == 'T' and (text[i] == 'S' or text[i] == 's'):
|
|
281
|
+
result = result[:-1]
|
|
282
|
+
result += "Ц"
|
|
283
|
+
elif i > 0 and text[i - 1] == 't' and ord(text[i]) == ord('s'):
|
|
284
|
+
result = result[:-1]
|
|
285
|
+
result += "ц"
|
|
286
|
+
elif i > 0 and text[i - 1] == 'Y' and (ord(text[i]) == ord('U') or ord(text[i]) == ord('u')):
|
|
287
|
+
result = result[:-1]
|
|
288
|
+
result += "Ю"
|
|
289
|
+
elif i > 0 and text[i - 1] == 'y' and ord(text[i]) == ord('u'):
|
|
290
|
+
result = result[:-1]
|
|
291
|
+
result += "ю"
|
|
292
|
+
elif i > 0 and text[i - 1] == 'Y' and (ord(text[i]) == ord('A') or ord(text[i]) == ord('a')):
|
|
293
|
+
result = result[:-1]
|
|
294
|
+
result += "Я"
|
|
295
|
+
elif i > 0 and text[i - 1] == 'y' and ord(text[i]) == ord('a'):
|
|
296
|
+
result = result[:-1]
|
|
297
|
+
result += "я"
|
|
298
|
+
elif ord(text[i]) == ord("'") or ord(text[i]) == ord("`") or ord(text[i]) == ord("ʻ") or ord(text[i]) == ord("ʼ") or ord(text[i]) == ord("‘") or ord(text[i]) == ord("’"):
|
|
299
|
+
if text.isupper():
|
|
300
|
+
result += "Ъ"
|
|
301
|
+
else:
|
|
302
|
+
result += "ъ"
|
|
303
|
+
elif self.__LotinAlifbo.find(text[i]) + 1:
|
|
304
|
+
result += self.__KrillAlifbo[self.__LotinAlifbo.find(text[i])]
|
|
305
|
+
else:
|
|
306
|
+
result += text[i]
|
|
307
|
+
|
|
308
|
+
return result
|
|
309
|
+
|
|
310
|
+
def YangiLotinga(self, text): # noqa
|
|
311
|
+
result = ""
|
|
312
|
+
text = self.__change_apostrophe(text)
|
|
313
|
+
for i in range(len(text)):
|
|
314
|
+
if i == 0 and ord(text[i]) == ord('Е'):
|
|
315
|
+
if text.isupper():
|
|
316
|
+
result += "YE"
|
|
317
|
+
else:
|
|
318
|
+
result += "Ye"
|
|
319
|
+
elif i == 0 and ord(text[i]) == ord('е'):
|
|
320
|
+
result += "ye"
|
|
321
|
+
elif i > 0 and text[i - 1] in [' ', 'А', 'E', 'И', 'О', 'У', 'Ў', 'Ъ'] and ord(text[i]) == ord('Е'):
|
|
322
|
+
if text[i - 1] == 'Ъ':
|
|
323
|
+
result = result[:-1]
|
|
324
|
+
if text.isupper():
|
|
325
|
+
result += "YE"
|
|
326
|
+
else:
|
|
327
|
+
result += "Ye"
|
|
328
|
+
elif i > 0 and text[i - 1] in [' ', 'а', 'е', 'и', 'о', 'у', 'ў', 'ъ'] and ord(text[i]) == ord('е'):
|
|
329
|
+
if text[i - 1] == 'ъ':
|
|
330
|
+
result = result[:-1]
|
|
331
|
+
result += "ye"
|
|
332
|
+
elif ord(text[i]) == ord('Е'):
|
|
333
|
+
result += "E"
|
|
334
|
+
elif ord(text[i]) == ord('е'):
|
|
335
|
+
result += "e"
|
|
336
|
+
elif ord(text[i]) == ord('Э'):
|
|
337
|
+
result += "E"
|
|
338
|
+
elif ord(text[i]) == ord('э'):
|
|
339
|
+
result += "e"
|
|
340
|
+
elif ord(text[i]) == ord('С'):
|
|
341
|
+
result += "S"
|
|
342
|
+
elif ord(text[i]) == ord('с'):
|
|
343
|
+
result += "s"
|
|
344
|
+
elif ord(text[i]) == ord('Ў'):
|
|
345
|
+
result += "Ō"
|
|
346
|
+
elif ord(text[i]) == ord('ў'):
|
|
347
|
+
result += "ō"
|
|
348
|
+
elif ord(text[i]) == ord('Ғ'):
|
|
349
|
+
result += "Ḡ"
|
|
350
|
+
elif ord(text[i]) == ord('ғ'):
|
|
351
|
+
result += "ḡ"
|
|
352
|
+
elif i > 0 and text[i - 1] == 'O' and text[i] == '‘':
|
|
353
|
+
result = result[:-1]
|
|
354
|
+
result += "Ō"
|
|
355
|
+
elif i > 0 and text[i - 1] == 'o' and text[i] == '‘':
|
|
356
|
+
result = result[:-1]
|
|
357
|
+
result += "ō"
|
|
358
|
+
elif i > 0 and text[i - 1] == 'G' and text[i] == '‘':
|
|
359
|
+
result = result[:-1]
|
|
360
|
+
result += "Ḡ"
|
|
361
|
+
elif i > 0 and text[i - 1] == 'g' and text[i] == '‘':
|
|
362
|
+
result = result[:-1]
|
|
363
|
+
result += "ḡ"
|
|
364
|
+
elif ord(text[i]) == ord('Ш'):
|
|
365
|
+
result += "Ş"
|
|
366
|
+
elif ord(text[i]) == ord('ш'):
|
|
367
|
+
result += "ş"
|
|
368
|
+
elif ord(text[i]) == ord('Ч'):
|
|
369
|
+
result += "Ç"
|
|
370
|
+
elif ord(text[i]) == ord('ч'):
|
|
371
|
+
result += "ç"
|
|
372
|
+
elif i > 0 and text[i - 1] == "S" and (ord(text[i]) == ord('H') or ord(text[i]) == ord('h')):
|
|
373
|
+
result = result[:-1]
|
|
374
|
+
result += "Ş"
|
|
375
|
+
elif i > 0 and text[i - 1] == "s" and ord(text[i]) == ord('h'):
|
|
376
|
+
result = result[:-1]
|
|
377
|
+
result += "ş"
|
|
378
|
+
elif i > 0 and text[i - 1] == "C" and (ord(text[i]) == ord('H') or ord(text[i]) == ord('h')):
|
|
379
|
+
result = result[:-1]
|
|
380
|
+
result += "Ç"
|
|
381
|
+
elif i > 0 and text[i - 1] == "c" and ord(text[i]) == ord('h'):
|
|
382
|
+
result = result[:-1]
|
|
383
|
+
result += "ç"
|
|
384
|
+
elif ord(text[i]) == ord('Ё'):
|
|
385
|
+
if text.isupper():
|
|
386
|
+
result += "YO"
|
|
387
|
+
else:
|
|
388
|
+
result += "Yo"
|
|
389
|
+
elif ord(text[i]) == ord('ё'):
|
|
390
|
+
result += "yo"
|
|
391
|
+
elif i > 0 and text[i - 1] in ['А', 'E', 'И', 'О', 'У', 'Ў'] and ord(text[i]) == ord('Ц'):
|
|
392
|
+
if text.isupper():
|
|
393
|
+
result += "TS"
|
|
394
|
+
else:
|
|
395
|
+
result += "Ts"
|
|
396
|
+
elif i > 0 and text[i - 1] in ['а', 'е', 'и', 'о', 'у', 'ў'] and ord(text[i]) == ord('ц'):
|
|
397
|
+
result += "ts"
|
|
398
|
+
elif ord(text[i]) == ord('Ц'):
|
|
399
|
+
result += "S"
|
|
400
|
+
elif ord(text[i]) == ord('ц'):
|
|
401
|
+
result += "s"
|
|
402
|
+
elif ord(text[i]) == ord('Ю'):
|
|
403
|
+
if text.isupper():
|
|
404
|
+
result += "YU"
|
|
405
|
+
else:
|
|
406
|
+
result += "Yu"
|
|
407
|
+
elif ord(text[i]) == ord('ю'):
|
|
408
|
+
result += "yu"
|
|
409
|
+
elif ord(text[i]) == ord('Я'):
|
|
410
|
+
if text.isupper():
|
|
411
|
+
result += "YA"
|
|
412
|
+
else:
|
|
413
|
+
result += "Ya"
|
|
414
|
+
elif ord(text[i]) == ord('я'):
|
|
415
|
+
result += "ya"
|
|
416
|
+
elif self.__KrillAlifbo.find(text[i]) + 1:
|
|
417
|
+
result += self.__YangiLotinAlifbo[self.__KrillAlifbo.find(text[i])]
|
|
418
|
+
else:
|
|
419
|
+
result += text[i]
|
|
420
|
+
|
|
421
|
+
return result
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: LotinKrillYangiLotin
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Dasturdan o‘zbek tilidagi matnlarni yozuv shaklinialmashtirishda va yangi lotin alifbosini joriy qilishdafoydalanish mumkin!
|
|
5
|
+
Home-page: https://github.com/ddasturbek/LotinKrillYangiLotin
|
|
6
|
+
Author: dasturbek
|
|
7
|
+
Author-email: sobirovogabek0409@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
Dasturdan ozbek tilidagi matnlarni yozuv shaklini almashtirishda
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
setup.py
|
|
3
|
+
LotinKrillYangiLotin/LotinKrillYangilotin.py
|
|
4
|
+
LotinKrillYangiLotin/__init__.py
|
|
5
|
+
LotinKrillYangiLotin.egg-info/PKG-INFO
|
|
6
|
+
LotinKrillYangiLotin.egg-info/SOURCES.txt
|
|
7
|
+
LotinKrillYangiLotin.egg-info/dependency_links.txt
|
|
8
|
+
LotinKrillYangiLotin.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LotinKrillYangiLotin
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: LotinKrillYangiLotin
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Dasturdan o‘zbek tilidagi matnlarni yozuv shaklinialmashtirishda va yangi lotin alifbosini joriy qilishdafoydalanish mumkin!
|
|
5
|
+
Home-page: https://github.com/ddasturbek/LotinKrillYangiLotin
|
|
6
|
+
Author: dasturbek
|
|
7
|
+
Author-email: sobirovogabek0409@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
Dasturdan ozbek tilidagi matnlarni yozuv shaklini almashtirishda
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Dasturdan ozbek tilidagi matnlarni yozuv shaklini almashtirishda
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='LotinKrillYangiLotin',
|
|
5
|
+
version='1.0.0',
|
|
6
|
+
author='dasturbek',
|
|
7
|
+
author_email='sobirovogabek0409@gmail.com',
|
|
8
|
+
description='Dasturdan o‘zbek tilidagi matnlarni yozuv shaklini'
|
|
9
|
+
'almashtirishda va yangi lotin alifbosini joriy qilishda'
|
|
10
|
+
'foydalanish mumkin!',
|
|
11
|
+
long_description=open('README.md').read(),
|
|
12
|
+
long_description_content_type='text/markdown',
|
|
13
|
+
url='https://github.com/ddasturbek/LotinKrillYangiLotin',
|
|
14
|
+
packages=find_packages(),
|
|
15
|
+
classifiers=[
|
|
16
|
+
'Programming Language :: Python :: 3',
|
|
17
|
+
'License :: OSI Approved :: MIT License',
|
|
18
|
+
'Operating System :: OS Independent',
|
|
19
|
+
],
|
|
20
|
+
python_requires='>=3.6',
|
|
21
|
+
)
|