This module contains functions for creating inflection tables for West Frisian verbs. It implements the tables for {{fy-infl-verb-irreg}}
, {{fy-infl-verb-st}}
, {{fy-infl-verb-wk1}}
, and {{fy-infl-verb-wk2}}
.
local m_utilities = require("Module:utilities")
local m_links = require("Module:links")
local m_table = require("Module:table")
local lang = require("Module:languages").getByCode("fy")
local export = {}
--Functions for the inflections
local inflections = {}
local irregverbs = {}
local hyphenated = m_table.listToSet {
-- double vowel
"aa", "ee", "ii", "oo", "uu", "yy",
-- diphthongs from ]
"au", "ou", "ei", "ij", "oi", "ui", "ea", "eo", "eu", "ie", "oa", "oe", "ue",
-- other
"ai", "io", "iy",
}
function export.show(frame)
local infl_type = frame.args or error("Inflection type has not been specified. Please pass parameter 1 to the module invocation.")
if not inflections then
error("Unknown inflection type '" .. infl_type .. "'")
end
params = {
= {}
}
for key, val in pairs(inflections.params) do
params = val
end
local args = require("Module:parameters").process(frame:getParent().args, params)
local data = {forms = {}, info = nil, categories = {}}
inflections.func(args, data)
local sep = args
if sep then
add_sep(args, data)
data.info = data.info .. ", separable"
table.insert(data.categories, lang:getCanonicalName() .. " separable verbs")
table.insert(data.categories, lang:getCanonicalName() .. " separable verbs with " .. sep)
end
return make_table(data, args) .. m_utilities.format_categories(data.categories, lang)
end
-- Add the separable part to all the verb forms
function add_sep(args, data)
sep = args
-- Add main clause forms
local mainforms = {}
local vowel_cluster
for key, form in pairs(data.forms) do
if (key:find("_pres_") or key:find("_past_")) and not key:find("_ptc$") then
mainforms = mw.clone(form)
end
end
for key, form in pairs(mainforms) do
data.forms = form
end
-- Add separable part to forms
for key, form in pairs(data.forms) do
if key:find("_main$") or key:find("^impr") then
-- For main-clause finite forms, add the separable part after the form, separated by a space
for i, subform in ipairs(data.forms) do
data.forms = data.forms .. " " .. sep
end
else
-- For all other forms, add the separable part before the form, with no space
for i, subform in ipairs(data.forms) do
vowel_cluster = sep:sub(-1) .. subform:sub(1, 1)
if (hyphenated) then
subform = sep .. "-" .. subform
else
subform = sep .. subform
end
data.forms = subform
end
end
end
end
inflections = {
params = {
= {required = true, default = "{{{1}}}"},
= {},
},
func = function(args, data)
local stem_pres = args
local stem_pres_e = args or stem_pres .. "e"
local stem_past = stem_pres_e:find("e$") and stem_pres or (stem_pres .. (stem_pres_e:find("e$") and "t" or "d"))
local stem_past_e = stem_pres_e:find("e$") and stem_pres_e or (stem_pres .. (stem_pres_e:find("e$") and "t" or "d") .. "e")
table.insert(data.categories, lang:getCanonicalName() .. " class 1 weak verbs")
data.info = "weak class 1"
data.forms = {stem_pres}
data.forms = {stem_pres .. (mw.ustring.find(stem_pres, "s$") and "" or "s") .. "t"}
data.forms = {stem_pres .. (mw.ustring.find(stem_pres, "t$") and "" or "t")}
data.forms = {stem_pres_e}
data.forms = {stem_past_e}
data.forms = {stem_past_e .. "st"}
data.forms = {stem_past_e}
data.forms = {stem_past_e .. "n"}
data.forms = {stem_pres}
data.forms = {stem_pres_e}
data.forms = {stem_pres_e .. "n"}
data.forms = {stem_pres_e .. "nd"}
data.forms = {stem_past, stem_past == stem_pres and stem_past_e .. "n" or nil}
end
}
inflections = {
params = {
= {required = true, default = "{{{1}}}"},
= {},
},
func = function(args, data)
local stem_pres = args
local stem_pres_e = args or stem_pres .. "e"
table.insert(data.categories, lang:getCanonicalName() .. " class 2 weak verbs")
data.info = "weak class 2"
data.forms = {stem_pres .. "je"}
data.forms = {stem_pres_e .. "st"}
data.forms = {stem_pres_e .. "t"}
data.forms = {stem_pres .. "je"}
data.forms = {stem_pres_e}
data.forms = {stem_pres_e .. "st"}
data.forms = {stem_pres_e}
data.forms = {stem_pres_e .. "n"}
data.forms = {stem_pres .. "je"}
data.forms = {stem_pres .. "je"}
data.forms = {stem_pres .. "jen"}
data.forms = {stem_pres .. "jend"}
data.forms = {stem_pres_e}
end
}
inflections = {
params = {
= {required = true, default = "{{{1}}}"},
= {},
= {required = true, default = "{{{3}}}"},
= {},
= {required = true, default = "{{{5}}}", list = "past_ptcp"},
= {},
},
func = function(args, data)
local stem_pres = args
local stem_pres_e = args or stem_pres .. "e"
local stem_past = args
local stem_past_e = args or stem_past .. "e"
table.insert(data.categories, lang:getCanonicalName() .. (args and " class " .. args or "") .. " strong verbs")
data.info = "strong" .. (args and " class " .. args or "")
data.forms = {stem_pres}
data.forms = {stem_pres .. (mw.ustring.find(stem_pres, "s$") and "" or "s") .. "t"}
data.forms = {stem_pres .. (mw.ustring.find(stem_pres, "t$") and "" or "t")}
data.forms = {stem_pres_e}
data.forms = {stem_past}
data.forms = {stem_past .. (mw.ustring.find(stem_pres, "s$") and "" or "s") .. "t"}
data.forms = {stem_past}
data.forms = {stem_past_e .. "n"}
data.forms = {stem_pres}
data.forms = {stem_pres_e}
data.forms = {stem_pres_e .. "n"}
data.forms = {stem_pres_e .. "nd"}
data.forms = args
end
}
inflections = {
params = {
= {required = true, default = "wêze"},
},
func = function(args, data)
data.forms = irregverbs].forms
table.insert(data.categories, lang:getCanonicalName() .. " irregular verbs")
data.info = "Irregular"
-- Check if verb is suppletive
if irregverbs].supl then
data.info = "Irregular (Suppletive)"
table.insert(data.categories,lang:getCanonicalName().. " suppletive verbs")
end
end
}
local names = {
= "1st singular",
= "2nd singular",
= "3rd singular",
= "plural",
}
-- Make the table
function make_table(data, hasSep)
local function repl(param)
if param == "info" then
return mw.getContentLanguage():ucfirst(data.info or "")
end
local forms = data.forms
if param == "gerund" then
forms = data.forms
end
--Return hawwe if regular
if param == "aux_verb" and not forms then return "]" end
if not forms then
return "—"
end
local ret = {}
for key, form in ipairs(forms) do
table.insert(ret, m_links.full_link({lang = lang, term = form, genders = (param == "gerund" and {"n"} or nil)}))
end
return table.concat(ret, ", ")
end
local rows = {"1sg", "2sg", "3sg", "pl"}
local wikicode = {}
table.insert(wikicode, "{| class=\"inflection-table vsSwitcher\" data-toggle-category=\"inflection\" style=\"border:1px solid var(--wikt-palette-indigo-3, #CCCCFF);\" cellspacing=\"1\" cellpadding=\"3\"")
table.insert(wikicode, "|- style=\"background: var(--wikt-palette-indigo-3, #CCCCFF);\"")
table.insert(wikicode, "! colspan=\"5\" class=\"vsToggleElement\" style=\"text-align: left\" | {{{info}}}")
-- Principal parts
table.insert(wikicode, "|- class=\"vsShow\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF); min-width: 10em;\" | infinitive")
table.insert(wikicode, "| style=\"min-width: 12em;\" | {{{inf}}}")
table.insert(wikicode, "|- class=\"vsShow\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | 3rd singular past")
if hasSep then
table.insert(wikicode, "| {{{3sg_past_indc_main}}}")
else
table.insert(wikicode, "| {{{3sg_past_indc}}}")
end
table.insert(wikicode, "|- class=\"vsShow\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | past participle")
table.insert(wikicode, "| {{{past_ptcp}}}")
-- Infinitives
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF); min-width: 10em;\" | infinitive")
table.insert(wikicode, "| colspan=\"4\" | {{{inf}}}")
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | long infinitive")
table.insert(wikicode, "| colspan=\"4\" | {{{inf_long}}}")
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | gerund")
table.insert(wikicode, "| colspan=\"4\" | {{{gerund}}}")
--Auxiliary
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | auxiliary")
table.insert(wikicode, "| colspan=\"4\" | {{{aux_verb}}}")
-- Indicative
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-1, #E6E6FF);\"")
if hasSep then
table.insert(wikicode, "|")
table.insert(wikicode, "! colspan=\"2\" style=\"min-width: 12em;\" | main clause")
table.insert(wikicode, "! colspan=\"2\" style=\"min-width: 12em;\" | subordinate clause")
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-1, #E6E6FF);\"")
table.insert(wikicode, "! indicative")
table.insert(wikicode, "! style=\"min-width: 12em;\" | present tense")
table.insert(wikicode, "! style=\"min-width: 12em;\" | past tense")
table.insert(wikicode, "! style=\"min-width: 12em;\" | present tense")
table.insert(wikicode, "! style=\"min-width: 12em;\" | past tense")
else
table.insert(wikicode, "! indicative")
table.insert(wikicode, "! style=\"min-width: 12em;\" | present tense")
table.insert(wikicode, "! style=\"min-width: 12em;\" | past tense")
end
for _, row in ipairs(rows) do
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF)\" | " .. names)
if hasSep then
table.insert(wikicode, "| {{{" .. row .. "_pres_indc_main}}}")
table.insert(wikicode, "| {{{" .. row .. "_past_indc_main}}}")
end
table.insert(wikicode, "| {{{" .. row .. "_pres_indc}}}")
table.insert(wikicode, "| {{{" .. row .. "_past_indc}}}")
end
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-1, #E6E6FF); height: 0.5em\"")
table.insert(wikicode, "|")
table.insert(wikicode, "| colspan=\"4\" |")
-- Imperative
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | imperative")
table.insert(wikicode, "| {{{impr}}}")
table.insert(wikicode, "| colspan=\"3\" style=\"background: var(--wikt-palette-indigo-1, #E6E6FF);\" | ")
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-1, #E6E6FF); height: 0.5em\"")
table.insert(wikicode, "|")
table.insert(wikicode, "| colspan=\"4\" |")
-- Participles
table.insert(wikicode, "|- class=\"vsHide\" style=\"background: var(--wikt-palette-indigo-0, #F2F2FF);\"")
table.insert(wikicode, "! style=\"background: var(--wikt-palette-indigo-2, #CCCCFF);\" | participles")
table.insert(wikicode, "| {{{pres_ptcp}}}")
table.insert(wikicode, "| {{{past_ptcp}}}")
if hasSep then
table.insert(wikicode, "| colspan=\"2\" style=\"background: var(--wikt-palette-indigo-1, #E6E6FF);\" | ")
end
table.insert(wikicode, "|}")
wikicode = table.concat(wikicode, "\n")
return mw.ustring.gsub(wikicode, "{{{(+)}}}", repl)
end
--[=[
*** IRREGULAR VERB CONJUGATIONS ***
]=]--
irregverbs = {
forms = {
= {"bin"},
= {"bist"},
= {"is"},
= {"binne"},
= {"wie"},
= {"wiest"},
= {"wie"},
= {"wienen"},
= {"wês"},
= {"wêze"},
= {"wêzen"},
= {"wêzend", "wêzende"},
= {"west"},
= {"hawwe"}
},
supl = true
}
irregverbs = {
forms = {
= {"gean"},
= {"giest"},
= {"giet"},
= {"geane"},
= {"gie", "gong", "gyng"},
= {"giest", "gongst", "gyngst"},
= {"gie", "gong", "gyng"},
= {"gongen", "gienen", "gyngen"},
= {"gean"},
= {"gean"},
= {"gean"},
= {"geanend", "geanende"},
= {"gien", "gongen"},
= {"wêze"}
},
supl = true
}
irregverbs = {
forms = {
= {"ha", "haw"},
= {"hast"},
= {"hat"},
= {"hawwe"},
= {"hie"},
= {"hiest"},
= {"hie"},
= {"hiene", "hienen"},
= {"haw"},
= {"hawwe"},
= {"hawwen"},
= {"hawwend", "hawwende"},
= {"hân"},
= {"hawwe"}
}
}
irregverbs = {
forms = {
= {"jou"},
= {"joust"},
= {"jout"},
= {"jouwe"},
= {"joech"},
= {"joechst"},
= {"joech"},
= {"joegen"},
= {"jou"},
= {"jaan"},
= {"jaan"},
= {"jaand", "jaande"},
= {"jûn"},
= {"hawwe"}
}
}
irregverbs = {
forms = {
= {"doch"},
= {"dochst"},
= {"docht"},
= {"dogge"},
= {"die", "diich", "dyng"},
= {"diest", "diichst", "dyngst"},
= {"die", "diich", "dyng"},
= {"dienen", "diene", "digen", "dyngen"},
= {"doch"},
= {"dwaan"},
= {"dwaan"},
= {"dwaand", "dwaande"},
= {"dien"},
= {"hawwe"}
}
}
irregverbs = {
forms = {
= {"stean"},
= {"stiest"},
= {"stiet"},
= {"steane"},
= {"stie"},
= {"stiest"},
= {"stie"},
= {"stiene"},
= {"stean"},
= {"stean"},
= {"stean"},
= {"steand", "steande"},
= {"stien"},
= {"hawwe"}
}
}
irregverbs = {
forms = {
= {"sis"},
= {"seist", "seiste"},
= {"seit"},
= {"sizze"},
= {"sei"},
= {"seist", "seiste", "seidest", "seideste"},
= {"sei"},
= {"seine", "seiene", "seien", "seinen"},
= {"sis"},
= {"sizze"},
= {"sizzen"},
= {"sizzend"},
= {"sein"},
= {"hawwe"}
}
}
return export