This module will transliterate Southern Selkup language text.
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:sel-sou-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 u = mw.ustring.char
local macron = u(0x0304)
local acute = u(0x0300)
local tt = {
='A', ='a',
="’a", ="’a",
='B', ='b',
='W', ='w',
='G', ='g',
='Ģ', ='ģ',
='D', ='d',
='Je', ='je',
="Jo", ="jo",
='Ž', ='ž',
='Ǯ', ='ǯ',
='Z', ='z',
='I', ='i',
="Ï", ="ї",
="J", ="j",
='K', ='k',
='Q', ='q',
='L', ='l',
='M', ='m',
='N', ='n',
="Ŋ", ="ŋ",
='O', ='o',
='Ö', ='ö',
='P', ='p',
='R', ='r',
='S', ='s',
='T', ='t',
='U', ='u',
='Ü', ='ü',
="Ū", ="ū",
='F', ='f',
='X', ='x',
="X", ="x",
='C', ='c',
='Č', ='č',
='Š', ='š',
="Šč", ="šč",
="Y", ="y",
="", ="",
="’", ="’",
="E", ="e",
="Ju", ="ju",
="Ja", ="ja",
}
local vowel = "аӓеёиӣоӧуӱӯыэюяАӒЕЁИӢОӦУӰӮЫЭЮЯ"
function export.tr(text, lang, sc)
-- initial j + vowels
text = mw.ustring.gsub(text, "^" .. "я" .. macron, "jā")
text = mw.ustring.gsub(text, "^" .. "е" .. macron, "je")
text = mw.ustring.gsub(text, "^" .. "ӣ", "jī")
text = mw.ustring.gsub(text, "^" .. "ю" .. macron, "jū")
text = mw.ustring.gsub(text, "^" .. "Я" .. macron, "Jā")
text = mw.ustring.gsub(text, "^" .. "Е" .. macron, "Jē")
text = mw.ustring.gsub(text, "^" .. "Ӣ", "Jī")
text = mw.ustring.gsub(text, "^" .. "Ю" .. macron, "Jū")
text = mw.ustring.gsub(text, " " .. "я" .. macron, "jā")
text = mw.ustring.gsub(text, " " .. "е" .. macron, "je")
text = mw.ustring.gsub(text, " " .. "ӣ", "jī")
text = mw.ustring.gsub(text, " " .. "ю" .. macron, "jū")
text = mw.ustring.gsub(text, " " .. "Я" .. macron, "Jā")
text = mw.ustring.gsub(text, " " .. "Е" .. macron, "Jē")
text = mw.ustring.gsub(text, " " .. "Ӣ", "Jī")
text = mw.ustring.gsub(text, " " .. "Ю" .. macron, "Jū")
return (mw.ustring.gsub(text, '.', tt))
end
return export