def transliterate(name):
dictionary = {'a':'а','b':'б','v':'в','g':'г','d':'д','e':'e',
'zh':'ж','z':'з','i':'и','y':'й','k':'к','l':'л','m':'м','n':'н',
'o':'о','p':'п','r':'р','s':'с','t':'т','u':'у','f':'ф','kh':'х',
'ts':'ц','ch':'ч','sh':'ш','shch':'щ','ъ':'','ie':'ы','ь':'','ei':'э',
'yu':'ю','ja':'я'}
i=0
while i<len(name):
for key in dictionary:
index = 1
while (index!=4):
if (name[i:index] == key[0:index]):
print(name[i:index] + ' = ' + key[0:index])
index+=1
else:
index=4
i+=1
transliterate("jayu")
def translit(name):
dictionary = {'a':'а','b':'б','v':'в','g':'г','d':'д','e':'e',
'zh':'ж','z':'з','i':'и','y':'й','k':'к','l':'л','m':'м','n':'н',
'o':'о','p':'п','r':'р','s':'с','t':'т','u':'у','f':'ф','kh':'х',
'ts':'ц','ch':'ч','sh':'ш','shch':'щ','ъ':'','ie':'ы','ь':'','ei':'э',
'yu':'ю','ja':'я'}
end_index = 0
start_index = 0
while start_index < len(name):
last_match = ''
while end_index < len(name)+1:
if name[start_index:end_index] in dictionary:
last_match = name[start_index:end_index]
end_index += 1
print(last_match, '=', dictionary[last_match])
start_index += len(last_match)
end_index = 0
def transliter(string):
l_dict = {'a':'а','b':'б','v':'в','g':'г','d':'д','e':'e',
'zh':'ж','z':'з','i':'и','y':'й','k':'к','l':'л','m':'м','n':'н',
'o':'о','p':'п','r':'р','s':'с','t':'т','u':'у','f':'ф','kh':'х',
'ts':'ц','ch':'ч','sh':'ш','shch':'щ','ъ':'','ie':'ы','ь':'','ei':'э',
'yu':'ю','ja':'я'}
translit_string = []
for char in string:
translit_string.append(l_dict[char])
return "".join(translit_string)
print(transliter("opa")