User:KarikaSlayer/li-conj

local m_links = require("Module:links") local m_utils = require("Module:utilities")

local lang = require("Module:languages").getByCode("li") local export = {}

-- Verbs that take "zeen" in the past participle. local AUX_ZEEN = { "zeen", "baere", }

-- Functions that do the actual inflecting by creating the forms of a basic term. local inflections = {} local irregular = {}

-- The main entry point. -- This is the only function that can be invoked from a template. function export.show(frame) local infl_type = frame.args[1] == nil and guess_conjugation or frame.args[1] if not inflections[infl_type] then error("Unknown inflection type '" .. infl_type .. "'") end local data = {forms = {}, categories = {}} data.info = "" local args = require("Module:parameters").process(frame:getParent.args, inflections[infl_type].params) local word = (mw.title.getCurrentTitle.nsText == "Template" and "blósse" or mw.title.getCurrentTitle.text) data.form["aux"] = AUX_ZEEN.word and "zeen" or "höbbe" -- Generate the forms inflections[infl_type].func(args, data) return make_table(data) end

local function guess_conjugation(umlaut) -- Strip final -e local stem = (mw.title.getCurrentTitle.nsText == "Template" and "blósse" or mw.title.getCurrentTitle.text):sub(1, -2) if frame.args["umlaut"] then local final_vowel = stem:sub(-4, -2) -- second, third, fifth, sixth if final_vowel == "ae" then return "second" elseif final_vowel == "ei" then return "third" elseif final_vowel == "ou" then return "fifth" elseif final_vowel:sub(-2, -1) == "a" then return "sixth" else return "irregular" end else local final = stem:sub(-2, -1) -- first, fourth, seventh if final:find("[jlnrtw]") then return "first" elseif final:find("[bdfgkps]") or stem:sub(-3, -1) == "ch" then return "fourth" elseif final == "m" then return "seventh" else return "irregular" end end end

inflections["first"] = { params = { [1] = {},		[2] = {},		},	func = function(args, data) local stem = mw.title.getCurrentTitle.nsText == "Template" and "-" or mw.title.getCurrentTitle.text -- If the final consonant is doubled, simplify it for certain forms local single = (base:sub(-2, -2) == base:sub(-1, -1)) and base:sub(1, -2) or base data.forms["inf"] = {base .. "e"} data.forms["ger"] = {base .. "e"} data.forms["pres_p"] = {base .. "endj"} data.forms["past_p"] = {"ge" .. single} data.forms["adj"] = {"ge" .. single .. "dje", "ge" .. single .. "djer", "ge" .. single .. "djes"} data.forms["adv"] = {"ge" .. single .. "dj", "ge" .. single .. "djelik"} data.forms["pres_1s_sv"] = {single} data.forms["past_1s_sv"] = {single .. "dje"} data.forms["sub_1s_sv"] = {base .. "e"} data.forms["pres_1s_vs"] = {single} data.forms["past_1s_vs"] = {single .. "dje-n"} data.forms["sub_1s_vs"] = {base .. "e-n"} data.forms["pres_2s_sv"] = {single .. "s"} data.forms["past_2s_sv"] = {single .. "djes"} data.forms["sub_2s_sv"] = {base .. "e"} data.forms["pres_2s_vs"] = {single .. "s"} data.forms["past_2s_vs"] = {single .. "djes"} data.forms["sub_2s_vs"] = {base .. "er"} data.forms["pres_3s_sv"] = {single .. "tj"} data.forms["past_3s_sv"] = {single .. "dje"} data.forms["sub_3s_sv"] = {base .. "e"} data.forms["pres_3s_vs"] = {single .. "tj'r"} data.forms["pres_3s_vs_pron"] = "" data.forms["past_3s_vs"] = {single .. "dje"} data.forms["sub_3s_vs"] = {base .. "er"} data.forms["pres_1p_sv"] = {base .. "e"} data.forms["past_1p_sv"] = {single .. "dje"} data.forms["sub_1p_sv"] = {base .. "e"} data.forms["pres_1p_vs"] = {single .. "tj"} data.forms["past_1p_vs"] = {single .. "dje"} data.forms["sub_1p_vs"] = {base .. "e"} data.forms["pres_2p_sv"] = {single .. "tj"} data.forms["past_2p_sv"] = {single .. "dje"} data.forms["sub_2p_sv"] = {base .. "e"} data.forms["pres_2p_vs"] = {single .. "tj"} data.forms["past_2p_vs"] = {single .. "dje"} data.forms["sub_2p_vs"] = {base .. "etj"} data.forms["pres_3p_sv"] = {base .. "e"} data.forms["past_3p_sv"] = {single .. "dje"} data.forms["sub_3p_sv"] = {base .. "e"} data.forms["pres_3p_vs"] = {base .. "e"} data.forms["past_3p_vs"] = {single .. "dje"} data.forms["sub_3p_vs"] = {base .. "er"} data.forms["noun"] = {"ge" .. single} data.forms["imp_sg_imp"] = {single} data.forms["imp_sg_pol"] = {single .. "tj"} data.forms["imp_du"] = {single .. "tj", base .. "etj"} data.forms["imp_pl"] = {single .. "tj"} data.forms["incl"] = {base .. "em"} end } inflections["fourth"] = { params = { [1] = {},		[2] = {},		},	func = function(args, data) local stem = mw.title.getCurrentTitle.nsText == "Template" and "-" or mw.title.getCurrentTitle.text -- If the final consonant is doubled, simplify it for certain forms local single = (base:sub(-2, -2) == base:sub(-1, -1)) and base:sub(1, -2) or base data.forms["inf"] = {base .. "e"} data.forms["ger"] = {base .. "e"} data.forms["pres_p"] = {base .. "endj"} data.forms["past_p"] = {"ge" .. single} data.forms["adj"] = {"ge" .. single .. "dje", "ge" .. single .. "djer", "ge" .. single .. "djes"} data.forms["adv"] = {"ge" .. single, "ge" .. single .. "djelik"} data.forms["pres_1s_sv"] = {single} data.forms["past_1s_sv"] = {single .. "dje"} data.forms["sub_1s_sv"] = {base .. "e"} data.forms["pres_1s_vs"] = {single} data.forms["past_1s_vs"] = {single .. "dje-n"} data.forms["sub_1s_vs"] = {base .. "e-n"} data.forms["pres_2s_sv"] = {single:sub(-1, -1) == "s" and single or single .. "s"} data.forms["past_2s_sv"] = {single .. "djes"} data.forms["sub_2s_sv"] = {base .. "e"} data.forms["pres_2s_vs"] = {single:sub(-1, -1) == "s" and single or single .. "s"} data.forms["past_2s_vs"] = {single .. "djes"} data.forms["sub_2s_vs"] = {base .. "er"} data.forms["pres_3s_sv"] = {single} data.forms["past_3s_sv"] = {single .. "dje"} data.forms["sub_3s_sv"] = {base .. "e"} data.forms["pres_3s_vs"] = {single} data.forms["past_3s_vs"] = {single .. "dje"} data.forms["sub_3s_vs"] = {base .. "er"} data.forms["pres_1p_sv"] = {base .. "e"} data.forms["past_1p_sv"] = {single .. "dje"} data.forms["sub_1p_sv"] = {base .. "e"} data.forms["pres_1p_vs"] = {single .. "tj"} data.forms["past_1p_vs"] = {single .. "dje"} data.forms["sub_1p_vs"] = {base .. "e"} data.forms["pres_2p_sv"] = {single, single .. "tj"} data.forms["past_2p_sv"] = {single .. "dje"} data.forms["sub_2p_sv"] = {base .. "e"} data.forms["pres_2p_vs"] = {single, single .. "tj"} data.forms["past_2p_vs"] = {single .. "dje"} data.forms["sub_2p_vs"] = {base .. "etj"} data.forms["pres_3p_sv"] = {base .. "e"} data.forms["past_3p_sv"] = {single .. "dje"} data.forms["sub_3p_sv"] = {base .. "e"} data.forms["pres_3p_vs"] = {base .. "e"} data.forms["past_3p_vs"] = {single .. "dje"} data.forms["sub_3p_vs"] = {base .. "er"} data.forms["noun"] = {"ge" .. single} data.forms["imp_sg_imp"] = {single} data.forms["imp_sg_pol"] = {single, single .. "tj"} data.forms["imp_du"] = {base .. "etj"} data.forms["imp_pl"] = {single .. "tj"} data.forms["incl"] = {base .. "em"} end }

inflections["seventh"] = { params = { [1] = {},		[2] = {},		},	func = function(args, data) local stem = mw.title.getCurrentTitle.nsText == "Template" and "-" or mw.title.getCurrentTitle.text -- If the final consonant is doubled, simplify it for certain forms local single = (base:sub(-2, -2) == base:sub(-1, -1)) and base:sub(1, -2) or base data.forms["inf"] = {base .. "e"} data.forms["ger"] = {base .. "e"} data.forms["pres_p"] = {base .. "endj"} data.forms["past_p"] = {"ge" .. single .. "p"} data.forms["adj"] = {"ge" .. single .. "pdje", "ge" .. single .. "pdjer", "ge" .. single .. "pdjes"} data.forms["adv"] = {"ge" .. single .. "p", "ge" .. single .. "pdjelik"} data.forms["pres_1s_sv"] = {single} data.forms["past_1s_sv"] = {single .. "dje"} data.forms["sub_1s_sv"] = {base .. "e"} data.forms["pres_1s_vs"] = {single} data.forms["past_1s_vs"] = {single .. "dje-n"} data.forms["sub_1s_vs"] = {base .. "e-n"} data.forms["pres_2s_sv"] = {single .. "s"} data.forms["past_2s_sv"] = {single .. "djes"} data.forms["sub_2s_sv"] = {base .. "e"} data.forms["pres_2s_vs"] = {single .. "s"} data.forms["past_2s_vs"] = {single .. "djes"} data.forms["sub_2s_vs"] = {base .. "er"} data.forms["pres_3s_sv"] = {single .. "p"} data.forms["past_3s_sv"] = {single .. "dje"} data.forms["sub_3s_sv"] = {base .. "e"} data.forms["pres_3s_vs"] = {single .. "p"} data.forms["past_3s_vs"] = {single .. "dje"} data.forms["sub_3s_vs"] = {base .. "er"} data.forms["pres_1p_sv"] = {base .. "e"} data.forms["past_1p_sv"] = {single .. "dje"} data.forms["sub_1p_sv"] = {base .. "e"} data.forms["pres_1p_vs"] = {single .. "p"} data.forms["past_1p_vs"] = {single .. "dje"} data.forms["sub_1p_vs"] = {base .. "e"} data.forms["pres_2p_sv"] = {single .. "p"} data.forms["past_2p_sv"] = {single .. "dje"} data.forms["sub_2p_sv"] = {base .. "e"} data.forms["pres_2p_vs"] = {single .. "p"} data.forms["past_2p_vs"] = {single .. "dje"} data.forms["sub_2p_vs"] = {base .. "etj"} data.forms["pres_3p_sv"] = {base .. "e"} data.forms["past_3p_sv"] = {single .. "dje"} data.forms["sub_3p_sv"] = {base .. "e"} data.forms["pres_3p_vs"] = {base .. "e"} data.forms["past_3p_vs"] = {single .. "dje"} data.forms["sub_3p_vs"] = {base .. "er"} data.forms["noun"] = {"ge" .. single} data.forms["imp_sg_imp"] = {single} data.forms["imp_sg_pol"] = {single, single .. "p"} data.forms["imp_du"] = {single .. "tj", base .. "etj"} data.forms["imp_pl"] = {single .. "p"} data.forms["incl"] = {base .. "em"} end }

inflections["irregular"] = { params = { [1] = {},		[2] = {}		},	func = function(args, data) local base = args[2] or (mw.title.getCurrentTitle.nsText == "Template" and "zeen" or mw.title.getCurrentTitle.text) if irregular[base] then irregular[base](data) else error("Unknown irregular adjective '" .. base .. "'.") end end }

irregular["baere"] = function(data) table.insert(data.categories, "Limburgish irregular verbs") data.info = " (irregular)"

data.forms["inf"] = {"baere"} data.forms["ger"] = {"baere"} data.forms["pres_p"] = {"baerendj"} data.forms["past_p"] = {"gebaore"} data.forms["adj"] = {"gebaore", "gebaorer", "gebaores"} data.forms["adv"] = {"gebaorelik"} data.forms["pres_1s_sv"] = {"baer"} data.forms["past_1s_sv"] = {"boor"} data.forms["sub_1s_sv"] = {"baere"} data.forms["pres_1s_vs"] = {"bèr"} data.forms["past_1s_vs"] = {"boor"} data.forms["sub_1s_vs"] = {"baere-n"} data.forms["pres_2s_sv"] = {"bèrs"} data.forms["past_2s_sv"] = {"boors"} data.forms["sub_2s_sv"] = {"baere"} data.forms["pres_2s_vs"] = {"bèrs"} data.forms["past_2s_vs"] = {"boors"} data.forms["sub_2s_vs"] = {"bèrrer"} data.forms["pres_3s_sv"] = {"bèrtj"} data.forms["past_3s_sv"] = {"boor"} data.forms["sub_3s_sv"] = {"baere"} data.forms["pres_3s_vs"] = {"bèrtj'r"} data.forms["pres_3s_vs_pron"] = "" data.forms["past_3s_vs"] = {"boor"} data.forms["sub_3s_vs"] = {"bèrrer"} data.forms["pres_1p_sv"] = {"baere"} data.forms["past_1p_sv"] = {"bore"} data.forms["sub_1p_sv"] = {"baere"} data.forms["pres_1p_vs"] = {"bèrtj"} data.forms["past_1p_vs"] = {"boortj"} data.forms["sub_1p_vs"] = {"bèrre"} data.forms["pres_2p_sv"] = {"baertj"} data.forms["past_2p_sv"] = {"boortj"} data.forms["sub_2p_sv"] = {"baere"} data.forms["pres_2p_vs"] = {"baertj"} data.forms["past_2p_vs"] = {"boortj"} data.forms["sub_2p_vs"] = {"bèrretj"} data.forms["pres_3p_sv"] = {"baere"} data.forms["past_3p_sv"] = {"bore"} data.forms["sub_3p_sv"] = {"baere"} data.forms["pres_3p_vs"] = {"baere"} data.forms["past_3p_vs"] = {"bore"} data.forms["sub_3p_vs"] = {"bèrrer"} data.forms["noun"] = {"gebèr"} data.forms["imp_sg_imp"] = {"baer"} data.forms["imp_sg_pol"] = {"bèrtj"} data.forms["imp_du"] = {"bèr"} data.forms["imp_pl"] = {"baertj"} data.forms["incl"] = {"baerem"} end

irregular["bèdzje"] = function(data) table.insert(data.categories, "Limburgish irregular verbs") data.info = " (irregular)"

data.forms["inf"] = {"bèdzje"} data.forms["ger"] = {"bèdzje"} data.forms["pres_p"] = {"bèdzjendje"} data.forms["past_p"] = {"gebótsj"} data.forms["adj"] = {"gebótsj", "gebódzje", "gebódzjer", "gebódzjes"} data.forms["adv"] = {"gebódzjelik"} data.forms["pres_1s_sv"] = {"bètsj"} data.forms["past_1s_sv"] = {"batsj"} data.forms["sub_1s_sv"] = {"bèdzje"} data.forms["pres_1s_vs"] = {"bètsj"} data.forms["past_1s_vs"] = {"batsj"} data.forms["sub_1s_vs"] = {"bèdzje-n"} data.forms["pres_2s_sv"] = {"bèdzjes"} data.forms["past_2s_sv"] = {"badzjes"} data.forms["sub_2s_sv"] = {"bèdzje"} data.forms["pres_2s_vs"] = {"bèdzjes"} data.forms["past_2s_vs"] = {"badzjes"} data.forms["sub_2s_vs"] = {"bèdzjer"} data.forms["pres_3s_sv"] = {"bètsj"} data.forms["past_3s_sv"] = {"batsj"} data.forms["sub_3s_sv"] = {"bèdzje"} data.forms["pres_3s_vs"] = {"bètsj"} data.forms["past_3s_vs"] = {"batsj"} data.forms["sub_3s_vs"] = {"bèdzjer"} data.forms["pres_1p_sv"] = {"bèdzje"} data.forms["past_1p_sv"] = {"badzje"} data.forms["sub_1p_sv"] = {"bèdzje"} data.forms["pres_1p_vs"] = {"bètsj"} data.forms["past_1p_vs"] = {"batsj"} data.forms["sub_1p_vs"] = {"bèdzje"} data.forms["pres_2p_sv"] = {"bètsj"} data.forms["past_2p_sv"] = {"batsj"} data.forms["sub_2p_sv"] = {"bèdzje"} data.forms["pres_2p_vs"] = {"bètsj"} data.forms["past_2p_vs"] = {"batsj"} data.forms["sub_2p_vs"] = {"bèdzjetj"} data.forms["pres_3p_sv"] = {"bèdzje"} data.forms["past_3p_sv"] = {"badzje"} data.forms["sub_3p_sv"] = {"bèdzje"} data.forms["pres_3p_vs"] = {"bèdzje"} data.forms["past_3p_vs"] = {"badzje"} data.forms["sub_3p_vs"] = {"bèdzjer"} data.forms["noun"] = {"gebótsj"} data.forms["imp_sg_imp"] = {"bètsj"} data.forms["imp_sg_pol"] = {"bötsj"} data.forms["imp_du"] = {"buuetsj"} data.forms["imp_pl"] = {"boeatsj"} data.forms["incl"] = {"bötsjem"} end

irregular["doon"] = function(data) table.insert(data.categories, "Limburgish irregular verbs") data.info = " (irregular)"

data.forms["inf"] = {"doon"} data.forms["ger"] = {"doon"} data.forms["pres_p"] = {"donendje"} data.forms["past_p"] = {"gedaon"} data.forms["adj"] = {"gedaon", "gedaone", "gedaoner", "gedaones"} data.forms["adv"] = {"gedäöndjelik"} data.forms["pres_1s_sv"] = {"doon"} data.forms["past_1s_sv"] = {"di-j"} data.forms["sub_1s_sv"] = {"daon"} data.forms["pres_1s_vs"] = {"doon"} data.forms["past_1s_vs"] = {"di-j"} data.forms["sub_1s_vs"] = {"daon"} data.forms["pres_2s_sv"] = {"deis"} data.forms["past_2s_sv"] = {"di-js"} data.forms["sub_2s_sv"] = {"daons"} data.forms["pres_2s_vs"] = {"deis"} data.forms["past_2s_vs"] = {"di-js"} data.forms["sub_2s_vs"] = {"daons"} data.forms["pres_3s_sv"] = {"deitj"} data.forms["past_3s_sv"] = {"di-j"} data.forms["sub_3s_sv"] = {"daontj"} data.forms["pres_3s_vs"] = {"deitj'r"} data.forms["pres_3s_vs_pron"] = "" data.forms["past_3s_vs"] = {"di-j"} data.forms["sub_3s_vs"] = {"daontj'r"} data.forms["sub_3s_vs_pron"] = "" data.forms["pres_1p_sv"] = {"doon"} data.forms["past_1p_sv"] = {"di-jje"} data.forms["sub_1p_sv"] = {"daone"} data.forms["pres_1p_vs"] = {"doontj"} data.forms["past_1p_vs"] = {"di-jtj"} data.forms["sub_1p_vs"] = {"daontj"} data.forms["pres_2p_sv"] = {"doontj"} data.forms["past_2p_sv"] = {"di-j"} data.forms["sub_2p_sv"] = {"daontj"} data.forms["pres_2p_vs"] = {"doontj"} data.forms["past_2p_vs"] = {"di-j", "di-jtj"} data.forms["sub_2p_vs"] = {"daontj"} data.forms["pres_3p_sv"] = {"doon"} data.forms["past_3p_sv"] = {"di-jje"} data.forms["sub_3p_sv"] = {"daone"} data.forms["pres_3p_vs"] = {"doon"} data.forms["past_3p_vs"] = {"di-jje"} data.forms["sub_3p_vs"] = {"daone"} data.forms["noun"] = {"gedoons"} data.forms["imp_sg_imp"] = {"dooch"} data.forms["imp_sg_pol"] = {"dootj"} data.forms["imp_du"] = {"doon"} data.forms["imp_pl"] = {"doontj"} data.forms["incl"] = {"daonem"} end

-- Make the table function make_table(data) local function show_form(form) if not form then return "&mdash;" end local ret = {} table.insert(ret, m_links.full_link(form, nil, lang, nil, nil, nil, {}, false)) return table.concat(ret, " ") end local function repl(param) if param == "lemma" then return m_links.full_link(nil, mw.title.getCurrentTitle.text, lang, nil, "term", nil, {}, false) elseif param == "info" then return data.info else return show_form(data.forms[param]) end end local wikicode = [=[ Conjugation of return (mw.ustring.gsub(wikicode, "", repl)) .. m_utils.format_categories(data.categories, lang) end

return export