Module:snon-mut: Difference between revisions

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


local GRAVE = "\204\128"
local GRAVE = "\204\128"
local ACUTE = "\204\129"
local CIRC = "\204\130"
local DIAER = "\204\136"


local lang = require("Module:languages").getByCode("cy")
local lang = require("Module:languages").getByCode("snon")
local PAGENAME = mw.loadData("Module:headword/data").pagename
local PAGENAME = mw.loadData("Module:headword/data").pagename
local MARKER = "<sup>△</sup>"
local MARKER = "<sup>△</sup>"
Line 22: Line 19:
["bh"] = {"b", "m", "gh"},
["bh"] = {"b", "m", "gh"},
["c"] = {"g", "ngh", "ch"},
["c"] = {"g", "ngh", "ch"},
["ch"] = {"gh", "ngh"},
["ch"] = {"gh", "ngh", "h"},
["d"] = {"dd", "n", "dh"},
["d"] = {"dd", "n", "dh"},
["dh"] = {"d", "n", "gh"},
["dh"] = {"d", "n", "gh"},
["g"] = {"gg", "ng", "gh"},
["g"] = {"gg", "ng", "gh"},
["h"] = {"gh", "nh", "ch"},
["h"] = {"gh", "nh", "ch"},
["l"] = {"lh"},
["l"] = {"ll", "l", "lh"},
["m"] = {"mh"},
["m"] = {"m", "mm", "mh"},
["n"] = {"nh"},
["n"] = {"n", "nn", "nh"},
["p"] = {"b", "mh", "ph"},
["p"] = {"b", "mh", "ph"},
["ph"] = {"bh", "mh", "h"},
["ph"] = {"bh", "mh", "h"},
["r"] = {"rr", "rh"},
["r"] = {"rr", "r", "rh"},
["s"] = {"z", "sh"},
["s"] = {"z", "s","sh"},
["t"] = {"d", "nh", "th"},
["t"] = {"d", "nh", "th"},
["th"] = {"dh", "nh", "h"},
["th"] = {"dh", "nh", "ch"},
}
}


Line 44: Line 41:
data.is_uppercase = term_lower ~= term
data.is_uppercase = term_lower ~= term
local normalized = toNFD(term_lower)
local normalized = toNFD(term_lower)
data.vowel = normalized:match("^[aeiouwy]") and true or false
data.vowel = normalized:match("^[aeiouøy]") and true or false
if data.vowel then
if data.vowel then
data.final = term_lower
data.final = term_lower
data.mut3 = "h"
data.mut1 = "gh-"
data.mut2 = "n-"
data.mut3 = "ch-"
return data
return data
end
end
Line 129: Line 128:
args = { title = '[[Appendix:Scots Norse mutations|Mutated forms]] of ' .. require("Module:links").full_link({lang = lang, alt = title}, 'term'), palette = 'green' } }
args = { title = '[[Appendix:Scots Norse mutations|Mutated forms]] of ' .. require("Module:links").full_link({lang = lang, alt = title}, 'term'), palette = 'green' } }
result = result .. '\n! [[radical]]'
result = result .. '\n! [[radical]]'
result = result .. '\n! [[soft mutation|voiced]]'
result = result .. '\n! ' .. (data.vowel and 'gh-prothesis' or '[[soft mutation|voiced]]')
result = result .. '\n! [[nasal mutation|nasal]]'
result = result .. '\n! ' .. (data.vowel and 'n-prothesis' or '[[nasal mutation|nasal]]')
result = result .. '\n! ' .. (data.vowel and '[[h-prothesis]]' or '[[aspirate mutation|aspirate]]')
result = result .. '\n! ' .. (data.vowel and 'ch-prothesis' or '[[aspirate mutation|aspirate]]')
result = result .. '\n|-'
result = result .. '\n|-'
result = result .. '\n| ' .. require("Module:links").full_link({lang = lang, term = data.radical})
result = result .. '\n| ' .. require("Module:links").full_link({lang = lang, term = data.radical})