မဝ်ဂျူ:my-translit
မံက်ပြာကတ်
- မဝ်ဂျူ တဏအ်ဝွံဟွံမွဲကဵုလိက်စၟတ်သမ္တီမချူလဝ်နကဵုမုက်လိက်ဓမၠေံ။ သ္ပဂုန်တုဲ ဍဵုခၞံဗဒှ်ဏံညိ။
- လေန်မရပ်စပ်သုၚ်စောဲ: စရၚ်မုက်လိက်ဓမၠေံ • လေန်ဂမၠိုၚ် • ပရေၚ်မပံၚ်စပ်ဂမၠိုၚ် • testcases • ကဠာသံၚ်ဗ္တဳ
local export = {}
local gsub = mw.ustring.gsub
local symbols = {
["၀"] = "0", ["၁"] = "1", ["၂"] = "2", ["၃"] = "3", ["၄"] = "4",
["၅"] = "5", ["၆"] = "6", ["၇"] = "7", ["၈"] = "8", ["၉"] = "9",
["၊"] = "|", ["။"] = "||"
}
function export.tr(text, lang, sc, debug_mode)
local m_pron = require("Module:my-pron").get_romanisation
text = gsub(text, ".", symbols)
for word in mw.ustring.gmatch(text, "[က-႟ꩠ-ꩻ]+") do
success, translit = pcall(m_pron, word, nil, { 2, ["type"] = "orthographic", ["name"] = "MLCTS" }, 2, "translit_module")
if success then
text = gsub(text, word, translit, 1)
else
return nil
end
end
if mw.ustring.match(text, "[က-႟ꩠ-ꩻ]") and not debug_mode then
return nil
end
return text
end
return export