Module:snon-mut: Difference between revisions
No edit summary |
No edit summary |
||
| (21 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
local GRAVE = "\204\128" | local GRAVE = "\204\128" | ||
local lang = require("Module:languages").getByCode(" | 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>" | ||
local mutation_rules = { | local mutation_rules = { | ||
["b"] = {" | ["b"] = {"bb", "m", "bh"}, | ||
["bh"] = {"b", "m", "gh"}, | |||
["c"] = {"g", "ngh", "ch"}, | ["c"] = {"g", "ngh", "ch"}, | ||
["ch"] = | ["ch"] = {"gh", "ngh", "h"}, | ||
["d"] = {"dd", "n"}, | ["d"] = {"dd", "n", "dh"}, | ||
[" | ["dh"] = {"d", "n", "gh"}, | ||
["g"] = {"gg", "ng", "gh"}, | |||
["g"] = {"", "ng"}, | ["h"] = {"gh", "nh", "ch"}, | ||
["h"] = | ["l"] = {"ll", "l", "lh"}, | ||
["m"] = {"m", "mm", "mh"}, | |||
["n"] = {"n", "nn", "nh"}, | |||
["l"] = | |||
["m"] = {" | |||
["n"] = | |||
["p"] = {"b", "mh", "ph"}, | ["p"] = {"b", "mh", "ph"}, | ||
["ph"] = | ["ph"] = {"bh", "mh", "h"}, | ||
["r"] = {"rr", "r", "rh"}, | |||
["s"] = {"z", "s","sh"}, | |||
[" | |||
["s"] = | |||
["t"] = {"d", "nh", "th"}, | ["t"] = {"d", "nh", "th"}, | ||
["th | ["th"] = {"dh", "nh", "ch"}, | ||
} | } | ||
| Line 55: | 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("^[ | 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.mut1 = "gh-" | ||
data.mut2 = "n-" | |||
data.mut3 = "ch-" | |||
return data | return data | ||
end | end | ||
| Line 85: | Line 70: | ||
end | end | ||
data.colloquial = mut.colloquial | data.colloquial = mut.colloquial | ||
end | end | ||
| Line 154: | Line 126: | ||
local result = frame:expandTemplate{ title = 'inflection-table-top', | local result = frame:expandTemplate{ title = 'inflection-table-top', | ||
args = { title = '[[Appendix: | 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| | 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 ' | 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}) | ||
| Line 169: | Line 141: | ||
end | end | ||
if has_soft or has_nasal or has_aspirate then | if has_soft or has_nasal or has_aspirate then | ||
notes = notes .. '<p style="font-size:85%;"><i>Note:</i> Certain mutated forms of some words can never occur in standard | notes = notes .. '<p style="font-size:85%;"><i>Note:</i> Certain mutated forms of some words can never occur in standard Scots Norse.<br>All possible mutated forms are displayed for convenience.</p>' | ||
end | end | ||
result = result .. '\n' .. frame:expandTemplate{ title = 'inflection-table-bottom', args = { notes = notes } } | result = result .. '\n' .. frame:expandTemplate{ title = 'inflection-table-bottom', args = { notes = notes } } | ||