انتقل إلى المحتوى

وحدة:lbe-translit

من ويكاموس، القاموس الحر
local export = {}

local tt = {
    ["б"]="b", ["п"]="p", ["ф"]="f", ["в"]="w", ["м"]="m",
    ["д"]="d", ["т"]="t", ["й"]="j", ["н"]="n", ["з"]="z", ["ц"]="c",
    ["с"]="s", ["ж"]="ž", ["ш"]="š", ["щ"]="š̄", 
    ["л"]="l", ["ч"]="č", ["р"]="r", ["г"]="g", ["к"]="k", ["х"]="χ", 
    ["ъ"]="ʾ", ["а"]="a", ["е"]="ə̱", ["ы"]="y", ["и"]="i", ["о"]="o", ["у"]="u", 
    ["ё"]="ë", ["ь"]="’", ["э"]="ə̱", ["ю"]="ju", ["я"]="ja",
    ["Б"]="B", ["П"]="P", ["Ф"]="F", ["В"]="W", ["М"]="M",
    ["Д"]="D", ["Т"]="T", ["Й"]="J", ["Н"]="N", ["З"]="Z", ["Ц"]="C",
    ["С"]="S", ["Ж"]="Ž", ["Ш"]="Š", ["Щ"]="Š̄", 
    ["Л"]="L", ["Ч"]="Č", ["Р"]="R", ["Г"]="G", ["К"]="K", ["Х"]="Χ", 
    ["Ъ"]="ʾ", ["А"]="A", ["Е"]="Ə̱", ["Ы"]="Y", ["И"]="I", ["О"]="O", ["У"]="U", 
    ["Ё"]="Ë", ["Ь"]="’", ["Э"]="Ə̱", ["Ю"]="Ju", ["Я"]="Ja"};

function export.tr(text, lang, sc)
	text = mw.ustring.gsub(text, 'хьхь', 'x̄')
	text = mw.ustring.gsub(text, 'Хьхь', 'X̄')
	text = mw.ustring.gsub(text, 'пп', 'p̄')
	text = mw.ustring.gsub(text, 'пӏ', 'ṗ')
	text = mw.ustring.gsub(text, 'тт', 't̄') 
	text = mw.ustring.gsub(text, 'аь', 'a̱')
	text = mw.ustring.gsub(text, 'оь', 'o̱')
	text = mw.ustring.gsub(text, 'Пп', 'P̄')
	text = mw.ustring.gsub(text, 'Пӏ', 'Ṗ')
	text = mw.ustring.gsub(text, 'Тт', 'T̄')
	text = mw.ustring.gsub(text, 'Аь', 'A̱')
	text = mw.ustring.gsub(text, 'Оь', 'O̱')
	text = mw.ustring.gsub(text, 'цӏ', 'c̣')
	text = mw.ustring.gsub(text, 'цц', 'c̄')
	text = mw.ustring.gsub(text, 'тӏ', 'ṭ')
	text = mw.ustring.gsub(text, 'сс', 's̄')
	text = mw.ustring.gsub(text, 'чч', 'č̄')
	text = mw.ustring.gsub(text, 'чӏ', 'č̣')
	text = mw.ustring.gsub(text, 'кь', 'q̇')
	text = mw.ustring.gsub(text, 'кк', 'k̄')
	text = mw.ustring.gsub(text, 'кӏ', 'ḳ')
	text = mw.ustring.gsub(text, 'хь', 'x')
	text = mw.ustring.gsub(text, 'хъ', 'q')
	text = mw.ustring.gsub(text, 'къ', 'q̄')
	text = mw.ustring.gsub(text, 'гъ', 'ġ')
	text = mw.ustring.gsub(text, 'хх', 'χ̄')
	text = mw.ustring.gsub(text, 'гӏ', 'ʿ')
	text = mw.ustring.gsub(text, 'хӏ', 'ḥ')
	text = mw.ustring.gsub(text, 'гь', 'h')
	text = mw.ustring.gsub(text, 'Цӏ', 'C̣')
	text = mw.ustring.gsub(text, 'Цц', 'C̄')
	text = mw.ustring.gsub(text, 'Тӏ', 'Ṭ')
	text = mw.ustring.gsub(text, 'Сс', 'S̄')
	text = mw.ustring.gsub(text, 'Чч', 'Č̄')
	text = mw.ustring.gsub(text, 'Чӏ', 'Č̣')
	text = mw.ustring.gsub(text, 'Кь', 'Q̇')
	text = mw.ustring.gsub(text, 'Кк', 'K̄')
	text = mw.ustring.gsub(text, 'Кӏ', 'Ḳ')
	text = mw.ustring.gsub(text, 'Хь', 'X')
	text = mw.ustring.gsub(text, 'Хъ', 'Q')
	text = mw.ustring.gsub(text, 'Къ', 'Q̄')
	text = mw.ustring.gsub(text, 'Гъ', 'Ġ')
	text = mw.ustring.gsub(text, 'Хх', 'Χ̄')
	text = mw.ustring.gsub(text, 'Гӏ', 'ʿ')
	text = mw.ustring.gsub(text, 'Хӏ', 'Ḥ')
	text = mw.ustring.gsub(text, 'Гь', 'H')
	text = mw.ustring.gsub(text, '.', tt)
	
	return text
end

return export