Module:Cprt-translit
Documentation for this module may be created at Module:Cprt-translit/doc
local export = {}
local chars = {
["๐ "] = "a",
["๐ "] = "e",
["๐ "] = "i",
["๐ "] = "o",
["๐ "] = "u",
["๐
"] = "ja",
-- je not in Unicode
-- ji not in Unicode
["๐ "] = "jo",
-- ju not in Unicode
["๐ "] = "ka",
["๐ "] = "ke",
["๐ "] = "ki",
["๐ "] = "ko",
["๐ "] = "ku",
["๐ "] = "la",
["๐ "] = "le",
["๐ "] = "li",
["๐ "] = "lo",
["๐ "] = "lu",
["๐ "] = "ma",
["๐ "] = "me",
["๐ "] = "mi",
["๐ "] = "mo",
["๐ "] = "mu",
["๐ "] = "na",
["๐ "] = "ne",
["๐ "] = "ni",
["๐ "] = "no",
["๐ "] = "nu",
["๐ "] = "pa",
["๐ "] = "pe",
["๐ "] = "pi",
["๐ ก"] = "po",
["๐ ข"] = "pu",
["๐ ฃ"] = "ra",
["๐ ค"] = "re",
["๐ ฅ"] = "ri",
["๐ ฆ"] = "ro",
["๐ ง"] = "ru",
["๐ จ"] = "sa",
["๐ ฉ"] = "se",
["๐ ช"] = "si",
["๐ ซ"] = "so",
["๐ ฌ"] = "su",
["๐ ญ"] = "ta",
["๐ ฎ"] = "te",
["๐ ฏ"] = "ti",
["๐ ฐ"] = "to",
["๐ ฑ"] = "tu",
["๐ ฒ"] = "wa",
["๐ ณ"] = "we",
["๐ ด"] = "wi",
["๐ ต"] = "wo",
-- wu not in Unicode
["๐ ท"] = "ksa",
["๐ ธ"] = "kse",
-- ksi not in Unicode
["๐ ฟ"] = "kso",
-- ksu not in Unicode
["๐ ผ"] = "za",
-- ze not in Unicode
-- zi not in Unicode
-- zo not in Unicode
-- zu not in Unicode
}
function export.tr(text, lang, sc)
local ret = {}
for c in mw.ustring.gmatch(text, ".") do
table.insert(ret, chars[c] or c)
end
return table.concat(ret, "-")
end
return export