Module:snon-common: Difference between revisions

Melinoë (talk | contribs)
Created page with "local export = {} local eclipsis_prefixes = { ["b"] = "m", ["c"] = "g", ["d"] = "n", ["f"] = "v", ["g"] = "n", ["p"] = "b", ["t"] = "d", ["ph"] = "bh", } function export.mutations(word, tag) local ret = {normal = word, len = word, ecl = word, an = word, hpro = word} local word_l = mw.ustring.lower(word) if tag ~= "nolen" then if mw.ustring.find(word_l, "^[bcdfgmpt]") then ret.len = mw.ustring.gsub(word, "^(.)", "%1h") elseif mw.ustring.find(word_l..."
 
Melinoë (talk | contribs)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 9: Line 9:
["p"] = "b",
["p"] = "b",
["t"] = "d",
["t"] = "d",
["ph"] = "bh",
["h"] = "n",
["s"] = "z",
["v"] = "b",
}
}


function export.mutations(word, tag)
function export.mutations(word, tag)
local ret = {normal = word, len = word, ecl = word, an = word, hpro = word}
local ret = {normal = word, len = word, ecl = word, hpro = word}
local word_l = mw.ustring.lower(word)
local word_l = mw.ustring.lower(word)
if tag ~= "nolen" then
if tag ~= "nolen" then
if mw.ustring.find(word_l, "^[bcdfgmpt]") then
if mw.ustring.find(word_l, "^[bcdfgmptsnlrv]") then
ret.len = mw.ustring.gsub(word, "^(.)", "%1h")
ret.len = mw.ustring.gsub(word, "^(.)", "%1h")
elseif mw.ustring.find(word_l, "^s[aeiouàèìòùlnr]") then
elseif mw.ustring.find(word_l, "^i[aeouàèòù]") then
ret.len = mw.ustring.gsub(word, "^(.)", "%1h")
ret.len = mw.ustring.gsub(word, "^(.)", "h%1")
ret.an = "t" .. word
elseif mw.ustring.find(word_l, "^[h]") then
elseif mw.ustring.find(word_l, "^[h]") then
ret.len = mw.ustring.gsub(word, "^(.)", "g%1")
ret.len = mw.ustring.gsub(word, "^(.)", "g%1")