Module:xchc-translit: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 11: Line 11:


local tt_lepik = {
local tt_lepik = {
["Е" .. M .. D]='Jo' .. M, ["е" .. M .. D]='jo' .. M,
["Е" .. D]='Jo', ["е" .. D]='jo',
["А"]='A', ["а"]='a',
["А"]='A', ["а"]='a',
["Я"]='Ja', ["я"]='ja',
["Я"]='Ja', ["я"]='ja',
Line 19: Line 22:
["Ғ"]='Gh', ["ғ"]='gh',
["Ғ"]='Gh', ["ғ"]='gh',
["Д[zз]"]='Dc', ["д[zз]"]='dc', ["Д[жž]"]='Dz', ["д[жž]"]='dz',
["Д"]='D', ["д"]='d', ["З"]='Z', ["з"]='z', ["Ж"]='Ž', ["ж"]='ž',
["Д"]='D', ["д"]='d', ["З"]='Z', ["з"]='z', ["Ж"]='Ž', ["ж"]='ž',
["Е(" .. M .. "?)" .. D]='Jo%1', ["е(" .. M .. "?)" .. D]='jo%1',
["Е"]='Je', ["е"]='je',
["Ы"]='I', ["ы"]='i',
["Ы"]='I', ["ы"]='i',
Line 34: Line 33:
["Ӈ"]='Ng', ["ӈ"]='ng',
["Ӈ"]='Ng', ["ӈ"]='ng',
["[ОO]" .. B]='A' .. D, ["[оo]" .. B]='a' .. D,
["О" .. M .. B]='A' .. DA, ["о" .. M .. B]='a' .. DA,
["О" .. M .. B]='A' .. DA, ["о" .. M .. B]='a' .. DA,
["О" .. B]='A' .. D, ["о"]='a' .. D,
["Е(" .. M .. "?)" .. D]='Jo%1', ["е(" .. M .. "?)" .. D]='jo%1',
["О"]='O', ["о"]='o',
["О"]='O', ["о"]='o',
Line 62: Line 60:
["Ш"]='Š', ["ш"]='š',
["Ш"]='Š', ["ш"]='š',
["Э" .. M .. B]='E' .. DA, ["э"]='e' .. DA,
["[ЭE]" .. M .. B]='E' .. DA, ["[эe]" .. M .. B]='e' .. DA,
["Э" .. B]='E' .. D, ["э"]='e' .. D,
["Э" .. B]='E' .. D, ["э" .. B]='e' .. D,
["Э"]='E', ["э"]='e',
["Э"]='E', ["э"]='e',
["[ЬІ]"]="J", ["[ьі]"]="j",
["І"]='J', ["і"]='j',
["Ь"]='Y', ["ь"]='y',
["[Ъъ]"]="'",
["[Ъъ]"]="'",
["([LNln])j([aeiouy])"]='%1y%2'
[M] = A,
};
};


Line 82: Line 80:
end
end
-- text = text:gsub("([Yy])e(" .. A .. ")" .. DA, "%1o%2")
text = mw.ustring.toNFD(text):gsub("([LNln])j([aeiouy])", "%1y%2")
:gsub("O" .. B, "A" .. D):gsub("o" .. B, "a" .. D)
:gsub(M,A)
:gsub(A .. D, DA):gsub(D .. A, DA)
return mw.ustring.toNFC(text)
return mw.ustring.toNFC(text):gsub("([Dd])z","%1c"):gsub("([Dd])ž","%1z")
end
end


return export
return export