Commit 3ee5289e authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Update utils.translit

parent a322f84b
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -9,13 +9,7 @@ def translit(s):
    table1 = str.maketrans("абвгдеёзийклмнопрстуфхъыьэАБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЬЭ",  "abvgdeezijklmnoprstufh'y'eABVGDEEZIJKLMNOPRSTUFH'Y'E")
    table2 = {'ж':'zh','ц':'ts','ч':'ch','ш':'sh','щ':'sch','ю':'ju','я':'ja',  'Ж':'Zh','Ц':'Ts','Ч':'Ch','Ш':'Sh','Щ':'Sch','Ю':'Ju','Я':'Ja', 
              '«':'', '»':'','"':'','\n':'_',' ':'_',"'":"",':':'_','':'N'}
    s = s.translate(table1)
    for k in table2.keys():
        s = s.replace(k,table2[k])
    return s.translate(table1)

def badsym(s):
    """Replace special web-symbols"""
    result = s
    table = {' ':'_', "'":"", '"':'', '':'N'}
    for k in table.keys():
        result = result.replace(k,table[k])
    return result;
 No newline at end of file
    return s
 No newline at end of file