This module will transliterate Udi language text per WT:UDI 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:udi-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 gsub = string.gsub
local u = require("Module:string utilities").char
local export = {}
local tt = {
="b", ="p", ="v", ="f", ="m", ="b",
="d", ="t", ="c", ="z", ="s", ="n",
="l", ="č", ="ž", ="š", ="r", ="g",
="k", ="χ", ="j", ="i", ="u", ="e",
="o", ="a", ="ə", ="gʲ",
};
local trigraphs = {
= 'ǯ:',
= 'ǯ:',
= 'č̣:',
}
local digraphs = {
= 'ṗ',
= 'ṭ',
= 'ʒ',
= 'c̣',
= 'ǯ',
= 'č̣',
= 'č:',
= 'ž:',
= 'ž:',
= 'š:',
= 'š:',
= 'ḳ',
= 'ɣ',
= 'q̇',
= 'q',
= 'h',
= 'ü',
= 'ö',
= 'ä',
= 'i̱',
= 'i̱',
= 'u̱',
= 'u̱',
= 'e̱',
= 'e̱',
= 'o̱',
= 'o̱',
= 'a̱',
= 'a̱',
= 'ə̱',
}
function export.tr(text, lang, sc)
if sc ~= "Cyrl" then
return nil
end
-- Convert capital to lowercase palochka. Lowercase is found in tables
-- above.
text = gsub(text, u(0x4C0), u(0x4CF))
for trigraph, translit in pairs(trigraphs) do
text = gsub(text, trigraph, translit)
end
for digraph, translit in pairs(digraphs) do
text = gsub(text, digraph, translit)
end
text = gsub(text, ".*", tt)
return text
end
return export