This module will transliterate Mariupol Greek language text per WT:GRK-MAR TR.
The module should preferably not be called directly from templates or other modules.
To use it from a template, use {{xlit}}
.
Within a module, use Module:languages#Language:transliterate.
For testcases, see Module:grk-mar-translit/testcases.
tr(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local export = {}
local tri = {
="Č", ="Č", ="Dž",
="č", ="č", ="dž",
}
local di = {
="G", ="Ð", ="Θ",
="g", ='ð', ='θ',
="Mb", ="Ng", ="Nd", ="Š", ="Š", ="Ž",
="C", ="C", ="Dz",
="mb", ="ng", ="nd", ="š", ="š", ="ž",
="c", ="c", ="dz",
}
local tab = {
="A", ="B", ="V", ="H", ="D",
="Je", ="Ž", ="Z", ="I", ="J", ="K", ="L",
="M", ="N", ="O", ="P", ="R", ="S",
="T", ="U", ="F", ="X", ="C", ="Č", ="Š",
="Ś", ="Y", ="E", ="Ju", ="Ja", ="ʹ",
='a', ='b', ='v', ='h', ='d',
='je', ='ž', ='z', ='i', ='j', ='k', ='l',
='m', ='n', ='o', ='p', ='r', ='s',
='t', ='u', ='f', ='x', ='c', ='č', ='š',
='y', ='e', ='ju', ='ja', ='ʹ', ='ś',
="A", ="V", ="H", ="Ð", ="E", ="Z", ="Θ",
="I", ="K", ="L", ="M", ="N", ="O", ="P",
="R", ="S", ="T", ="U", ="F", ="X",
="a", ="v", ="h", ="ð", ="e", ="z", ="θ",
="i", ="k", ="l", ="m", ="n", ="o", ="p",
="r", ="s", ="s", ="t", ="u", ="f", ="x",
-- accents
="Á", ="á", ="É", ="é", ="Í", ="í",
="Ó", ="ó", ="Ú", ="ú"
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(text, "Γι()", "J%1")
text = mw.ustring.gsub(text, "γι()", "j%1")
text = mw.ustring.gsub(text, '...',tri)
text = mw.ustring.gsub('Q' .. text, '...',tri)
text = mw.ustring.gsub('Q' .. text, '...',tri)
text = mw.ustring.gsub('Q' .. text, '...',tri)
text = mw.ustring.gsub(text, 'Q', '')
text = mw.ustring.gsub(text, '..',di)
text = mw.ustring.gsub('Q' .. text, '..',di)
text = mw.ustring.gsub('Q' .. text, '..',di)
text = mw.ustring.gsub(text, 'Q', '')
text = mw.ustring.gsub(text, '.',tab)
text = mw.ustring.gsub(text, "()j", "%1")
return (text)
end
return export