A modult a Modul:Sarb-translit/doc lapon tudod dokumentálni
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