Module:snon-mut: Difference between revisions
No edit summary |
No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 38: | Line 38: | ||
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]") and true or false | ||
if data.vowel then | if data.vowel then | ||
data.final = term_lower | data.final = term_lower | ||
if not (normalized:match("^i[aeiou]")) then | |||
data.mut1 = "gh-" | data.mut1 = "gh-" | ||
data.mut2 = "n-" | data.mut2 = "n-" | ||
data.mut3 = "h-" | data.mut3 = "h-" | ||
end | |||
return data | return data | ||
end | end | ||
| Line 107: | Line 109: | ||
local params = { | local params = { | ||
[1] = {}, | [1] = {}, | ||
[" | ["voiced"] = {}, | ||
["nasal"] = {}, | ["nasal"] = {}, | ||
["aspirate"] = {}, | ["aspirate"] = {}, | ||
| Line 118: | Line 120: | ||
local data = export.get_mutation_data(title) | local data = export.get_mutation_data(title) | ||
local | local voiced, has_voiced, has_irreg_voiced = construct_mutation(data, data.vowel and "gh-prothesis" or "voiced", data.mut1, args.voiced) | ||
local nasal, has_nasal, has_irreg_nasal = construct_mutation(data, "nasal", data.mut2, args.nasal) | local nasal, has_nasal, has_irreg_nasal = construct_mutation(data, data.vowel and "n-prothesis" or "nasal", data.mut2, args.nasal) | ||
local aspirate, has_aspirate, has_irreg_aspirate = construct_mutation(data, data.vowel and "h-prothesis" or "aspirate", data.mut3, args.aspirate) | local aspirate, has_aspirate, has_irreg_aspirate = construct_mutation(data, data.vowel and "h-prothesis" or "aspirate", data.mut3, args.aspirate) | ||
| Line 127: | Line 129: | ||
result = result .. '\n! ' .. (data.vowel and 'gh-prothesis' or '[[soft mutation|voiced]]') | result = result .. '\n! ' .. (data.vowel and 'gh-prothesis' or '[[soft mutation|voiced]]') | ||
result = result .. '\n! ' .. (data.vowel and 'n-prothesis' or '[[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| | result = result .. '\n! ' .. (data.vowel and 'h-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}) | ||
result = result .. '\n| ' .. | result = result .. '\n| ' .. voiced | ||
result = result .. '\n| ' .. nasal | result = result .. '\n| ' .. nasal | ||
result = result .. '\n| ' .. aspirate | result = result .. '\n| ' .. aspirate | ||
notes = '' | notes = '' | ||
if | if has_irreg_voiced or has_irreg_nasal or has_irreg_aspirate then | ||
notes = notes .. '<p style="font-size:85%;">' .. MARKER .. 'Irregular.</p>' | notes = notes .. '<p style="font-size:85%;">' .. MARKER .. 'Irregular.</p>' | ||
end | end | ||
if | if has_voiced 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 Scots Norse.<br>All possible mutated forms are displayed for convenience.</p>' | 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 } } | ||
if not args.nocat and ( | if not args.nocat and (has_irreg_voiced or has_irreg_nasal or has_irreg_aspirate) then | ||
result = result .. require("Module:utilities").format_categories(" | result = result .. require("Module:utilities").format_categories("Scots Norse terms with irregular mutation", lang) | ||
end | end | ||
return result | return result | ||