Module:snon-mut: Difference between revisions

Melinoë (talk | contribs)
No edit summary
Melinoë (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:


local mutation_rules = {
local mutation_rules = {
["b"] = {true, "m", "bh"},
["b"] = {"b", "m", "bh"},
["c"] = {"g", "ngh", "ch"},
["c"] = {"g", "ngh", "ch"},
["d"] = {true, "n", "dh"},
["d"] = {"d", "n", "dh"},
["g"] = {true, "ng", "gh"},
["g"] = {"g", "ng", "gh"},
["h"] = {"gh", "nh", "'"},
["h"] = {"gh", "nh", "'"},
["l"] = {true, true, "lh"},
["l"] = {"l", "l", "lh"},
["m"] = {"b", true, "mh"},
["m"] = {"b", "m", "mh"},
["n"] = {"d", true, "nh"},
["n"] = {"d", "n", "nh"},
["p"] = {"b", "mh", "ph"},
["p"] = {"b", "mh", "ph"},
["f"] = {"v", "mh", "fh"},
["f"] = {"v", "mh", "fh"},
["v"] = {"b", "m", "vh"},
["v"] = {"b", "m", "vh"},
["r"] = {true, true, "rh"},
["r"] = {"r", "r", "rh"},
["s"] = {"z", "nh","sh"},
["s"] = {"z", "nh","sh"},
["t"] = {"d", "nh", "th"},
["t"] = {"d", "nh", "th"},
["ch"] = true
}
}


Line 70: Line 69:
end
end
data.colloquial = mut.colloquial
data.colloquial = mut.colloquial
end
if initial == "tsi" then
-- "i" in "tsi" is retained if:
-- followed by a consonant (e.g. "tsips" → "jips")
-- followed by a semivowel (e.g. "tsiwawa" → "jiwawa", but "*tsiŵawa" → "*jŵawa"); "i" and "w" are semivowels if followed by any vowel, due to the preceding "i".
-- it has a diacritic (e.g. "tsïars" → "jïars")
if not (final:match("^[aeiouwy]") and not final:match("^[iw][aeiouwy]")) then
final = "i" .. final
-- If "i" in "tsi" is not retained, the following vowel cannot have a diaeresis unless it's followed by a vowel.
elseif not umatch(final, "^[aeiouwy]" .. DIAER .. "[" .. GRAVE .. ACUTE .. CIRC .. "]?[aeiouwy]") then
final = final:gsub("^([aeiouwy])" .. DIAER, "%1") -- If there's no diaeresis, this does nothing.
end
end
end