Module:snon-mut
Documentation for this module may be created at Module:snon-mut/doc
local m_links = require("Module:links")
local lang = require("Module:languages").getByCode("snon")
local export = {}
local function repl(forms, param)
if param ~= "normal" and forms[param] == forms["normal"] then
return "''not applicable''"
end
local ret = m_links.full_link({lang = lang, term = forms[param]})
return ret
end
local table_cons = [=[
! radical
! lenition
! nasal
! voiced
|-
| {{{normal}}}
| {{{len}}}
| {{{nas}}}
| {{{voi}}}
]=]
function export.mut(frame)
local params = {
[1] = {},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local title = mw.loadData("Module:headword/data").pagename
local forms = require("Module:snon-common").mutations(title, args[1])
local wikicode = mw.ustring.find(mw.ustring.lower(title), "^[aeiouøyàèìòùø̀ỳ]") and table_vowel or table_cons
local result = frame:expandTemplate{
title = 'inflection-table-top',
args = {
title = '[[Scots Norse mutations|Mutated forms]] of ' .. require("Module:links").full_link({lang = lang, alt = title}, 'term'),
palette = 'green'
}
}
result = result .. '\n'
result = result .. mw.ustring.gsub(wikicode, "{{{([a-z0-9_]+)}}}", function(param) return repl(forms, param) end)
result = result .. frame:expandTemplate{
title = 'inflection-table-bottom',
args = {
notes = '<p style="font-size:85%;"><i>Note:</i> Certain mutated forms of some words can never occur in standard Modern Irish.<br>All possible mutated forms are displayed for convenience.</p>'
}
}
return result
end
return export