Module:snon-common: Difference between revisions
No edit summary |
No edit summary |
||
| Line 16: | Line 16: | ||
function export.mutations(word, tag) | function export.mutations(word, tag) | ||
local ret = {normal = word, len = word, ecl | 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, "^[ | if mw.ustring.find(word_l, "^[bcdfgmpts]") then | ||
ret.len = mw.ustring.gsub(word, "^(.)", "%1h") | ret.len = mw.ustring.gsub(word, "^(.)", "%1h") | ||
elseif mw.ustring.find(word_l, "^ | elseif mw.ustring.find(word_l, "^i[aeouàèòù]") then | ||
ret.len = mw.ustring.gsub(word, "^(.)", "% | ret.len = mw.ustring.gsub(word, "^(.)", "h%1") | ||
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") | ||