Module:Armn-translit: Difference between revisions

Created page with "local export = {} local gsub = require("Module:string utilities").gsub local mapping = { ["ա"]="a", ["բ"]="b", ["գ"]="g", ["դ"]="d", ["ե"]="e", ["զ"]="z",["է"]="ē", ["ը"]="ə", ["թ"]="tʻ", ["ժ"]="ž", ["ի"]="i", ["լ"]="l", ["խ"]="x", ["ծ"]="c", ["կ"]="k", ["հ"]="h", ["ձ"]="j", ["ղ"]="ġ", ["ճ"]="č", ["մ"]="m", ["յ"]="y", ["ն"]="n", ["շ"]="š", ["ո"]="o", ["չ"]="čʻ", ["պ"]="p", ["ջ"]="ǰ", ["ռ"]="ṙ", ["ս"]="s", ["վ"]="v", ["տ"]="..."
 
fix mn ligature translit
Line 12: Line 12:
["Ձ"]="J", ["Ղ"]="Ġ", ["Ճ"]="Č", ["Մ"]="M", ["Յ"]="Y", ["Ն"]="N", ["Շ"]="Š", ["Ո"]="O",
["Ձ"]="J", ["Ղ"]="Ġ", ["Ճ"]="Č", ["Մ"]="M", ["Յ"]="Y", ["Ն"]="N", ["Շ"]="Š", ["Ո"]="O",
["Չ"]="Čʻ", ["Պ"]="P", ["Ջ"]="J̌", ["Ռ"]="Ṙ", ["Ս"]="S", ["Վ"]="V", ["Տ"]="T", ["Ր"]="R",
["Չ"]="Čʻ", ["Պ"]="P", ["Ջ"]="J̌", ["Ռ"]="Ṙ", ["Ս"]="S", ["Վ"]="V", ["Տ"]="T", ["Ր"]="R",
["Ց"]="Cʻ", ["Ւ"]="W", ["Փ"]="Pʻ", ["Ք"]="Kʻ", ["Օ"]="Ō", ["Ֆ"]="F", ["ﬓ "]="mn", ["ﬔ"]="me",
["Ց"]="Cʻ", ["Ւ"]="W", ["Փ"]="Pʻ", ["Ք"]="Kʻ", ["Օ"]="Ō", ["Ֆ"]="F", [""]="mn", ["ﬔ"]="me",
["ﬕ"]="mi", ["ﬖ"]="vn", ["ﬗ"]="mx", ["ՠ"]="ä", ["ֈ"]="hª",
["ﬕ"]="mi", ["ﬖ"]="vn", ["ﬗ"]="mx", ["ՠ"]="ä", ["ֈ"]="hª",
-- punctuation
-- punctuation
["՝"]=",", ["։"]=".", ["․"]=";", ["՛"]="́", ["՜"]="<sup>!</sup>", ["՞"]="<sup>?</sup>",
["՝"]=",", ["։"]=".", ["․"]=";", ["՛"]="́", ["՜"]="<sup>!</sup>", ["՞"]="<sup>?</sup>",
["՟"]=".", ["֊"]="-", ["՚"]="’", ['«']='“', ['»']='”', ['ՙ']='ʻ'
["՟"]=".", ["֊"]="-", ["՚"]="’", ['«']='“', ['»']='”', ['ՙ']='ʻ'
Line 20: Line 20:


local replacements = {
local replacements = {
-- desirable, but doesn't work: ['<sup>յ</sup>'] = 'ʸ',
-- desirable, but doesn't work: ['<sup>յ</sup>'] = 'ʸ',
['յ̵'] = '', --keep synchronized with ֈ
['յ̵'] = mapping['ֈ'],
['ղʻ'] = 'q',
['ղʻ'] = 'q',
['Ո[ւՒ]'] = 'U',
['Ո[ւՒ]'] = 'U',
Line 38: Line 38:


function export.tr(text, lang, sc)
function export.tr(text, lang, sc)
if sc and sc ~= "Armn" then
if type(lang) == "table" then
return nil
lang = lang:getFullCode()
end
end