Module:nsk-translit
Jump to navigation
Jump to search
- The following documentation is located at Module:nsk-translit/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module will transliterate Naskapi language text.
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
tr(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