This module will transliterate text in the Ancient South Arabian script. It is used to transliterate Minaean, Old South Arabian, Harami, Hadrami, Qatabanian, and Sabaean.
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:Sarb-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 correspondences = {
= "h", = "l", = "ḥ", = "m", = "q",
= "w", = "s²", = "r", = "b", = "t",
= "s¹", = "k", = "n", = "ḫ", = "ṣ",
= "s³", = "f", = "ʾ", = "ʿ", = "ḍ",
= "g", = "d", = "ġ", = "ṭ", = "z",
= "ḏ", = "y", = "ṯ", = "ẓ",
= " ",
}
local numbers = {
= "1",
= "5",
= "10",
= "50",
= "100",
= "1000",
}
function export.tr(text, lang, sc)
-- Interpret numbers.
-- Will not work for thousands!
text = text:gsub(
"𐩿(..-)𐩿",
function (number)
local value = 0
for digit in mw.ustring.gmatch(number, ".") do
value = value + numbers or error("The character " .. digit .. " in " .. number .. " does not have a numeric value.")
end
return value
end)
text = mw.ustring.gsub(text, ".", correspondences)
return text
end
return export