Modul:Linb-translit
Penampilan
- Berikut merupakan pendokumenan yang dijana oleh Modul:pendokumenan/functions/translit. [sunting]
- Pautan berguna: senarai sublaman โข pautan โข transklusi โข kes ujian โข kotak pasir
Modul ini akan mentransliterasi teks dalam Tulisan Linear B. Ia digunakan untuk mentransliterasi bahasa Yunani Mykenai.
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:Linb-translit/testcases.
Functions
[sunting]tr(text, lang, sc)- Transliterates a given piece of
textwritten in the script specified by the codesc, and language specified by the codelang. - When the transliteration fails, returns
nil.
local export = {}
local chars = {
["๐"] = "a",
["๐"] = "e",
["๐"] = "i",
["๐"] = "o",
["๐"] = "u",
["๐
"] = "da",
["๐"] = "de",
["๐"] = "di",
["๐"] = "do",
["๐"] = "du",
["๐"] = "ja",
["๐"] = "je",
-- ji not in Unicode
["๐"] = "jo",
["๐"] = "ju",
["๐"] = "ka",
["๐"] = "ke",
["๐"] = "ki",
["๐"] = "ko",
["๐"] = "ku",
["๐"] = "ma",
["๐"] = "me",
["๐"] = "mi",
["๐"] = "mo",
["๐"] = "mu",
["๐"] = "na",
["๐"] = "ne",
["๐"] = "ni",
["๐"] = "no",
["๐"] = "nu",
["๐"] = "pa",
["๐"] = "pe",
["๐ "] = "pi",
["๐ก"] = "po",
["๐ข"] = "pu",
["๐ฃ"] = "qa",
["๐ค"] = "qe",
["๐ฅ"] = "qi",
["๐ฆ"] = "qo",
-- qu not in Unicode
["๐จ"] = "ra",
["๐ฉ"] = "re",
["๐ช"] = "ri",
["๐ซ"] = "ro",
["๐ฌ"] = "ru",
["๐ญ"] = "sa",
["๐ฎ"] = "se",
["๐ฏ"] = "si",
["๐ฐ"] = "so",
["๐ฑ"] = "su",
["๐ฒ"] = "ta",
["๐ณ"] = "te",
["๐ด"] = "ti",
["๐ต"] = "to",
["๐ถ"] = "tu",
["๐ท"] = "wa",
["๐ธ"] = "we",
["๐น"] = "wi",
["๐บ"] = "wo",
-- wu not in Unicode
["๐ผ"] = "za",
["๐ฝ"] = "ze",
-- zi not in Unicode
["๐ฟ"] = "zo",
-- zu not in Unicode
["๐"] = "ha",
["๐"] = "ai",
["๐"] = "au",
["๐"] = "dwe",
["๐"] = "dwo",
["๐
"] = "nwo",
["๐"] = "phu",
["๐"] = "pte",
["๐"] = "rya",
["๐"] = "rai",
["๐"] = "ryo",
["๐"] = "tya",
["๐"] = "twe",
["๐"] = "two",
["๐"] = "*18",
["๐"] = "*19",
["๐"] = "*22",
["๐"] = "*34",
["๐"] = "*47",
["๐"] = "*49",
["๐"] = "*56",
["๐"] = "*63",
["๐"] = "*64",
["๐"] = "*79",
["๐"] = "*82",
["๐"] = "*83",
["๐"] = "*86",
["๐"] = "*89",
}
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