Module:snon-mut: Difference between revisions

Melinoë (talk | contribs)
No edit summary
Melinoë (talk | contribs)
No edit summary
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("^[aeiouøy]") and true or false
data.vowel = normalized:match("^[aeiou]") and true or false
if data.vowel then
if data.vowel then
Line 107: Line 107:
local params = {
local params = {
[1] = {},
[1] = {},
["soft"] = {},
["voiced"] = {},
["nasal"] = {},
["nasal"] = {},
["aspirate"] = {},
["aspirate"] = {},
Line 118: Line 118:
local data = export.get_mutation_data(title)
local data = export.get_mutation_data(title)


local soft, has_soft, has_irreg_soft = construct_mutation(data, "soft", data.mut1, args.soft)
local soft, 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 127:
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|lenition]]')
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| ' .. soft
result = result .. '\n| ' .. voiced
result = result .. '\n| ' .. nasal
result = result .. '\n| ' .. nasal
result = result .. '\n| ' .. aspirate
result = result .. '\n| ' .. aspirate
notes = ''
notes = ''
if has_irreg_soft or has_irreg_nasal or has_irreg_aspirate then
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 has_soft or has_nasal or has_aspirate then
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 (has_irreg_soft or has_irreg_nasal or has_irreg_aspirate) then
if not args.nocat and (has_irreg_soft or has_irreg_nasal or has_irreg_aspirate) then
result = result .. require("Module:utilities").format_categories("Welsh terms with irregular mutation", lang)
result = result .. require("Module:utilities").format_categories("Scots Norse terms with irregular mutation", lang)
end
end
return result
return result