local export = {}
local lang = require("Module:languages").getByCode("nn")
function export.main(frame)
local PAGENAME = mw.title.getCurrentTitle().text
local NAMESPACE = mw.title.getCurrentTitle().nsText
-- Retrieve and process arguments
local params = {
= {required = true, list = "pres_tense"},
= {required = true, list = "past_tense"},
= {required = true, list = "past_part"},
= {default = "", list = "pasv_inf"},
= {default = "", list = "pres_part"},
= {default = "", list = "imp"},
= {alias_of = 6},
= {},
= {type = "boolean"},
= {type = "boolean"},
= {type = "boolean"},
= {type = "boolean"},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
-- Figure out roots
local length = PAGENAME:len()
local cons1 = PAGENAME:sub(1, 1):find('')
local cons2 = PAGENAME:sub(2, 2):find('')
local root = PAGENAME
if not (length == 3 and cons1 and cons2) and PAGENAME:find('$') and length > 2 then
root = PAGENAME:sub(1, length-1)
end
local second_root = args or root
local root2 = root
if root:sub(length-1, length-1) == 'j' and length > 3 then
root2 = root:sub(1, length-2)
end
if PAGENAME:find('ast$') or PAGENAME:find('as$') then
args = true
args = true
end
local data = {lang = lang, pos_category = "verbs", categories = {}, inflections = {}}
-- Add inflections
args.label = "present tense"
table.insert(data.inflections, args)
args.label = "past tense"
table.insert(data.inflections, args)
args.label = "past participle"
table.insert(data.inflections, args)
if not (args or args) then
if args == "" then
args = second_root .. "ast"
end
args.label = "passive infinitive"
table.insert(data.inflections, args)
end
if not (args or args) then
if args == "" then
args = second_root .. "ande"
end
args.label = "present participle"
table.insert(data.inflections, args)
end
if not (args or args) then
if args == "" then
if root:sub(length-2, length-1) == 'mm' then
args = root:sub(1, length-2)
else
args = root2
end
end
args.label = "imperative"
table.insert(data.inflections, args)
end
return require('Module:headword').full_headword(data)
end
return export