This module will transliterate text in the Khutsuri script. It is used to transliterate Georgian and Old Georgian.
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:Geok-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 = {}
-- Keep synchronized with ] and ]
local gsub = mw.ustring.gsub
local mapping = {
-- Nuskhuri
="a", ="b", ="g", ="d", ="e", ="v", ="z", ="ē",
="t", ="i", ="ḳ", ="l", ="m", ="n", ="y", ="o",
="ṗ", ="ž", ="r", ="s", ="ṭ", ="wi", ="u", ="p",
="k", ="ɣ", ="q̇", ="š", ="č", ="c",
="ʒ", ="c̣", ="č̣", ="x", ="q", ="ǯ", ="h", ="ō", ="ə", ="ə",
-- Asomtavruli
="a", ="b", ="g", ="d", ="e", ="v", ="z", ="ē",
="t", ="i", ="ḳ", ="l", ="m", ="n", ="y", ="o",
="ṗ", ="ž", ="r", ="s", ="ṭ", ="wi", ="u", ="p",
="k", ="ɣ", ="q̇", ="š", ="č", ="c",
="ʒ", ="c̣", ="č̣", ="x", ="q", ="ǯ", ="h", ="ō", ="ə", ="ə",
}
local replacements = {
= 'u',
}
function export.tr(text, lang, sc)
if sc and sc ~= "Geok" then
return nil
end
for regex, replacement in pairs(replacements) do
text = mw.ustring.gsub(text, regex, replacement)
end
text = gsub(text, '.', mapping)
return text
end
return export