|
|
Line 43: |
Line 43: |
| end | | end |
| return "6", {word} | | return "6", {word} |
| end
| |
|
| |
| function export.head(frame)
| |
| local arguments = frame.args
| |
| local numbers = nil
| |
| local decl = {}
| |
| local word = arguments.word or PAGENAME
| |
| local args = {}
| |
|
| |
| if not alldata[word] then
| |
| if arguments.n and arguments.c and arguments[1] then
| |
| decl_type = arguments.n .. "-" .. arguments.c
| |
| numbers = {arguments[1]}
| |
| else
| |
| decl_type, numbers = export.detect_decl(word, arguments.n, arguments.c)
| |
| end
| |
|
| |
| if not decl_type then
| |
| error("Unknown declension '" .. decl_type .. "'")
| |
| end
| |
|
| |
| args = require("Module:parameters").process(arguments, alldata[decl_type].params, true)
| |
|
| |
| if numbers then
| |
| for i, number in ipairs(numbers) do
| |
| args[i] = number
| |
| end
| |
| end
| |
| end
| |
|
| |
| local pass = {forms = {}, categories = {}}
| |
|
| |
| pass.head = arguments["head"] or nil
| |
|
| |
| -- Generate the forms
| |
| if alldata[word] then
| |
| alldata[word](parent_args, pass)
| |
| else
| |
| alldata[decl_type](args, pass)
| |
| end
| |
|
| |
| return pass.forms[arguments.f .. "-" .. arguments.d]
| |
| end | | end |
|
| |
|
Line 124: |
Line 82: |
| | | |
| pass.head = parent_args["head"] or nil | | pass.head = parent_args["head"] or nil |
| | pass.proper = parent_args["proper"] and true or false |
| | | |
| -- Generate the forms | | -- Generate the forms |