Module:sel-nor-translit

This module will transliterate Northern 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-nor-translit/testcases.

Functions

edit
tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When the transliteration fails, returns nil.

local export = {}

local tab = {
	["А"]="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",	["Ц"]="C",	["ц"]="c",
	["Ч"]="Ć",  ["ч"]="ć",  ["Ш"]="Š",  ["ш"]="š",
	["Щ"]="Ś",	 ["щ"]="ś",  ["Ы"]="Y",  ["ы"]="y",
	["Э"]="E",	["э"]="e",	["Ю"]="Ju", ["ю"]="ju",
	["Я"]="Ja", ["я"]="ja",	["ъ"]="",	["ь"]="j"
}

function export.tr(text, lang, sc)
	return (mw.ustring.gsub(text, '.' ,tab))
end

return export