Module:xchc-translit: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
local u = mw.ustring.char
local u = mw.ustring.char
local M = u(0x0304)
local M = u(0x0304) -- COMBINING MACRON
local B = u(0x0306)
local B = u(0x0306) -- COMBINING BREVE
local D = u(0x0308)
local D = u(0x0308) -- COMBINING DIAERESIS
local MB = M .. B
local A = u(0x0301) -- COMBINING ACUTE
local DA = U(0x030B) -- COMBINING DOUBLE ACUTE
 


local export = {}
local export = {}
Line 56: Line 58:
end
end
return text
return text
end
local tt_lepik= {
[B .. M] = DA, [M] = A,
["Ь"]="Y", ["Ь"]="y",
["І"]='J', ["і"]='j',
["Э"]='E', ["э"]='e',
["О"]='O', ["о"]='o',
["Е" .. A .. D]='Jō', ["е" .. A .. D]='jō', ["Е" .. D]='Jo', ["е" .. D]='jo',
["А"]='A', ["а"]='a',
["Б"]='B', ["б"]='b',
["В"]='V', ["в"]='v',
["Г"]='G', ["г"]='g',
["Ғ"]='Gh', ["ғ"]='gh',
["Дз"]='Dc', ["дз"]='dc', ["Дж"]='Dz', ["дж"]='dz',
["Д"]='D', ["д"]='d',
["Е"]='Je', ["е"]='je',
["Ж"]='Ž', ["ж"]='ž',
["З"]='Z', ["з"]='z',
["И" .. B]='J', ["и" .. B]='j', ["И"]='Ji', ["и"]='ji',
["К"]='K', ["к"]='k',
["Л"]='L', ["л"]='l',
["М"]='M', ["м"]='m',
["Н"]='N', ["н"]='n',
["Ӈ"]='Ng', ["ӈ"]='ng',
["О"]='O', ["о"]='o',
["Ө" .. A]='O' .. DA, ["ө" .. A]='o' .. DA, ["Ө"]='O' .. D, ["ө"]='o' .. D,
["П"]='P', ["п"]='p',
["Р"]='R', ["р"]='r',
["С"]='S', ["с"]='s',
["Т"]='T', ["т"]='t',
["У"]='U', ["у"]='u',
["Ү" .. A]='U' .. DA, ["ү" .. A]='u' .. DA, ["Ү"]='U' .. D, ["ү"]='u' .. D,
["Ф"]='F', ["ф"]='f',
["ХӀ"]='H', ["хӀ"]='h', ["Х"]='Ch', ["х"]='ch',
["Ц"]='C', ["ц"]='c',
["Ч"]='Cs', ["ч"]='cs',
["Ш"]='Š', ["ш"]='š',
["Ы"]='I', ["ы"]='i',
["Ю"]='Ju', ["ю"]='ju',
["Я"]='Ja', ["я"]='ja',
["[Ъъ]"]="'",
};
function export.tr_lepik(text, lang, sc)
text = mw.ustring.toNFD(text)
for pat, repl in pairs(tt) do
text = mw.ustring.gsub(text, pat, repl)
end
return mw.ustring.toNFC(text)
end
end


return export
return export

Navigation menu