This module will transliterate Chuvash language text per WT:CV TR.
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:cv-translit/testcases.
tr(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local u = require("Module:string/char")
local ugsub = mw.ustring.gsub
local export = {}
local CARONBELOW = u(0x032c)
local tt = {
="A", ="a", ="Ă", ="ă", ="B", ="b", ="V", ="v", ="G", ="g",
="D", ="d", ="E", ="e", ="Jo", ="jo", ="Ĕ", ="ĕ", ="Ž", ="ž",
="Z", ="z", ="I", ="i", ="J", ="j", ="K", ="k", ="L", ="l",
="M", ="m",="N", ="n", ="O", ="o", ="P", ="p", ="R", ="r",
="S", ="s", ="Ś", ="ś", ="T", ="t", ="U", ="u", ="Ü", ="ü",
="F", ="f", ="H", ="h", ="Ts", ="ts", ="Č", ="č", ="Š", ="š",
="Šč", ="šč", ="ʺ", ="ʺ", ="Y", ="y", ="ʹ", ="ʹ", ="E", ="e",
="Ju", ="ju", ="Ja", ="ja"
};
local VOWEL1 = ""
local CONS = ""
local VOWEL2 = ""
local CHARC = ""
function export.tr(text, lang, sc)
text = ugsub(text, "(" .. VOWEL1 .. CHARC .. "?" .. CONS .. ")(" .. CHARC .. "?)%f" .. VOWEL2, "%1" .. CARONBELOW .. "%2")
text = ugsub(text, ".", tt)
return text
end
return export