Module:osx-conj

local export = {}

local m_conj_data = require("Module:osx-conj/data") local m_links = require("Module:links") local m_utils = require("Module:utilities")

local lang = require("Module:languages").getByCode("osx")

-- The main entry point. -- This is the only function that can be invoked from a template. function export.show(frame)

local parent_args = frame:getParent.args local conj_type = (frame.args["conj"] or parent_args["conj"]) or "wk1"

if not m_conj_data[conj_type] then error("Unknown conjugation '" .. conj_type .. "'") end local data = {forms = {}, categories = {}} data.head = parent_args["head"] or nil

local args = require("Module:parameters").process(parent_args, m_conj_data[conj_type].params, true) -- Override for templates if not args[1] then setmetatable(args, {__index = function(self, key)			return ""		end		}) end -- Generate the forms if parent_args.irr then table.insert(data.categories, "Old Saxon irregular verbs") if m_conj_data.irregular[parent_args.irr] then m_conj_data.irregular[parent_args.irr](data) else m_conj_data[conj_type](args, data) end else m_conj_data[conj_type](args, data) end

-- Make the table return make_table(data) end

function make_table(data) local function show_form(form) if not form then return "—" end local ret = {} for key, subform in ipairs(form) do			if mw.title.getCurrentTitle.nsText == "Reconstruction" and subform ~= "—" then subform = "*" .. subform end table.insert(ret, m_links.full_link({lang = lang, term = subform})) end return table.concat(ret, ", ") end local function repl(param) if param == "conj_type" then return data.conj_type 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