Modul:nsk-translit
- 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 Bahasa Naskapi teks.
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:nsk-translit/testcases.
Functions
suntingtr(text, lang, sc)
- Transliterates a given piece of
text
written in the script specified by the codesc
, and language specified by the codelang
. - When the transliteration fails, returns
nil
.
local export = {}
local replacements = {
["c"] = "ch",
["ī"] = "ii",
["ō"] = "oo",
["ā"] = "aa",
["o"] = "u",
["š"] = "sh",
["ð"] = "th",
["(.)ː"] = "%1%1",
"[ᔌᔍᔎᔏ]", {
["ᔌ"]="spwaa",
["ᔍ"]="stwaa",
["ᔎ"]="skwaa",
["ᔏ"]="schwaa",
}
}
function export.tr(text, lang, sc)
text = require("Module:Cans-translit").tr(text, lang, sc)
for regex, replacement in pairs(replacements) do
text = mw.ustring.gsub(text, regex, replacement)
end
return text
end
return export