Modul:Cprt-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 Cyprus. Ia digunakan untuk mentransliterasi bahasa Yunani Purba.
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:Cprt-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",
["๐
"] = "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