This module will transliterate text in the Khwarezmian script. It is used to transliterate Khwarezmian.
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:Chrs-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 tt = {
= "ʾ", -- aleph
= "ʾ", -- small aleph
= "β", -- beth
= "ɣ", -- gimel
= "d", -- daleth
= "h", -- he
= "w", -- waw
= "w", -- curled waw
= "z", -- zayin
= "x", -- heth
= "y", -- yodh
= "k", -- kaph
= "δ", -- lamedh
= "m", -- mem
= "n", -- nun
= "s", -- samekh
= "ʿ", -- ayin
= "p", -- pe
= "r", -- resh
= "š", -- shin
= "t", -- taw
= "1", -- one
= "2", -- two
= "3", -- three
= "4", -- four
= "10", -- ten
= "20", -- twenty
= "100", -- one hundred
}
function export.tr(text, lang, sc)
-- If the script is not Chrs, do not transliterate
if sc ~= "Chrs" then
return
end
-- Transliterate characters
text = mw.ustring.gsub(text, '.', tt)
return text
end
return export