Module:qhv-headword: Difference between revisions

No edit summary
No edit summary
Line 69: Line 69:
if pos_functions[poscat] then
if pos_functions[poscat] then
pos_functions[poscat](class, args, data)
pos_functions[poscat](class, parent_args, data)
end
end
Line 77: Line 77:
pos_functions.nouns = function(class, args, data)
pos_functions.nouns = function(class, args, data)
local params = {
local params = {
[1] = {list = "g", default = detect_gender(PAGENAME)},
[1] = {list = "g", default = detect_gender(args[1])},
[2] = {list = "gen"},
[2] = {list = "gen"},
[3] = {list = "pl"},
[3] = {list = "pl"},
[4] = {list = "dim"},
[4] = {list = "dim"},
["number"] = {},
["head"] = {},
["class"] = {},
["head"] = {default = PAGENAME},
["m"] = {list = true},
["m"] = {list = true},
["f"] = {list = true},
["f"] = {list = true},
Line 89: Line 87:
local args = require("Module:parameters").process(args, params)
local args = require("Module:parameters").process(args, params)
local decl_type = require("Module:qhv-noun").detect_decl(table.concat(data.heads), args["number"], args["class"])
local decl_args = require("Module:parameters").process(parent_args, m_data[decl_type].params, true)
data.heads = {args["head"]}
data.heads = {args["head"]}
local decl_type = require("Module:qhv-noun").detect_decl(table.concat(data.heads))
-- Gender
-- Gender