Modul:os-translit
This module will transliterate Ossetian text per WT:OS TR through the function tr.
--[[
Transliteration for Ossetian.
]]
local M={}
local tt={
["ӕ"]="æ",['Ӕ']='Æ', ["т"]="t",['Т']='T', ["р"]="r",['Р']='R', ["ф"]="f",['Ф']='F', ["э"]="è",['Э']='È',
["ю"]="ju",['Ю']='Ju', ["ш"]="š",['Ш']='Š', ["ь"]="ʹ",['Ь']='ʹ', ["ъ"]="ʺ",['Ъ']='ʺ', ["н"]="n",['Н']='N',
["п"]="p",['П']='P', ["й"]="j",['Й']='J', ["л"]="l",['Л']='L', ["з"]="z",['З']='Z', ["е"]="e",['Е']='E',
["г"]="g",['Г']='G', ["б"]="b",['Б']='B', ["у"]="u",['У']='U', ["с"]="s",['С']='S', ["х"]="x",['Х']='X',
["ч"]="ḱ",['Ч']='Ḱ', ["щ"]="šč",['Щ']='ŠČ', ["я"]="ja",['Я']='Ja', ["ы"]="y",['Ы']='Y', ["э"]="è",['Э']='È',
["м"]="m",['М']='M', ["о"]="o",['О']='O', ["и"]="i",['И']='I', ["ё"]="ë",['Ё']='Ë', ["ж"]="ž",['Ж']='Ž',
["к"]="k",['К']='K', ["д"]="d",['Д']='D', ["в"]="v",['В']='V', ["ц"]="c",['Ц']='C', ["а"]="a",['А']='A'
};
--[[Generated from prev.version using in console:
for k,v in pairs(tt1) do mw.log(table.concat({'["',k,'"]="',v,"\",['",mw.ustring.upper(k),"']='",mw.ustring.upper(v),"',\n"})) end
]]
-- One-string data: local tt="а=a\nА=A\nб=b\nБ=B\nв=v\nВ=V\n"...etc.
function M.tr(f)--translit any words or phrases
if type(f) == 'table' then f = f.args[1] end
f = mw.ustring.gsub(f, 'къуы', 'k’°y')
f = mw.ustring.gsub(f, 'Kъуы', 'K’°y')
f = mw.ustring.gsub(f, 'гуы', 'g°y')
f = mw.ustring.gsub(f, 'Гуы', 'G°y')
f = mw.ustring.gsub(f, 'куы', 'k°y')
f = mw.ustring.gsub(f, 'Kуы', 'K°y')
f = mw.ustring.gsub(f, 'хуы', 'x°y')
f = mw.ustring.gsub(f, 'Хуы', 'X°y')
f = mw.ustring.gsub(f, 'къ', 'k’')
f = mw.ustring.gsub(f, 'Къ', 'K’')
f = mw.ustring.gsub(f, 'пъ', 'p’')
f = mw.ustring.gsub(f, 'Пъ', 'P’')
f = mw.ustring.gsub(f, 'тъ', 't’')
f = mw.ustring.gsub(f, 'Tъ', 'T’')
f = mw.ustring.gsub(f, 'цъ', 'c’')
f = mw.ustring.gsub(f, 'Цъ', 'C’')
f = mw.ustring.gsub(f, 'чъ', 'ḱ’')
f = mw.ustring.gsub(f, 'Чъ', 'Ḱ’')
f = mw.ustring.gsub(f, 'хъ', 'q')
f = mw.ustring.gsub(f, 'Хъ', 'Q')
f = mw.ustring.gsub(f, 'гъ', 'ǧ')
f = mw.ustring.gsub(f, 'Гъ', 'Ǧ')
f = mw.ustring.gsub(f, 'дж', 'ǵ')
f = mw.ustring.gsub(f, 'Дж', 'Ǵ')
f = mw.ustring.gsub(f, 'дз', 'ʒ')
f = mw.ustring.gsub(f, 'Дз', 'Ʒ')
f = mw.ustring.gsub(f, 'ау', 'aw')
f = mw.ustring.gsub(f, 'Ау', 'Aw')
f = mw.ustring.gsub(f, 'ӕу', 'æw')
f = mw.ustring.gsub(f, 'Ӕу', 'Æw')
f = mw.ustring.gsub(f, 'иу', 'iw')
f = mw.ustring.gsub(f, 'Иу', 'Iw')
f = mw.ustring.gsub(f, 'ыу', 'yw')
f = mw.ustring.gsub(f, 'Ыу', 'Yw')
f = mw.ustring.gsub(f, 'еу', 'ew')
f = mw.ustring.gsub(f, 'Еу', 'Ew')
f = mw.ustring.gsub(f, 'уа', 'wa')
f = mw.ustring.gsub(f, 'Уа', 'Wa')
f = mw.ustring.gsub(f, 'уӕ', 'wæ')
f = mw.ustring.gsub(f, 'Уӕ', 'Wæ')
f = mw.ustring.gsub(f, 'уи', 'wi')
f = mw.ustring.gsub(f, 'Уи', 'Wi')
f = mw.ustring.gsub(f, 'уы', 'wy')
f = mw.ustring.gsub(f, 'Уы', 'Wy')
f = mw.ustring.gsub(f, 'уе', 'we')
f = mw.ustring.gsub(f, 'Уе', 'We')
f = mw.ustring.gsub(f, '.', tt)
return f
end
return M