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