Module:qhv-headword: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 58: Line 58:
-- This is the only function that can be invoked from a template.
-- This is the only function that can be invoked from a template.
function export.show(frame)
function export.show(frame)
local frame_args = frame.args
local parent_args = frame:getParent().args
local parent_args = frame:getParent().args
PAGENAME = mw.title.getCurrentTitle().text
PAGENAME = mw.title.getCurrentTitle().text
local head = parent_args["head"]; if head == "" then head = nil end
local head = parent_args["head"]; if head == "" then head = nil end
local pass = {forms = {}, categories = {}}
local poscat = frame_args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
local class = frame_args[2]; if class == "" then class = nil end
local class = frame.args[2]; if class == "" then class = nil end
local data = {lang = lang, pos_category = poscat, categories = {}, heads = {head}, genders = {}, inflections = {}}
local data = {lang = lang, pos_category = poscat, categories = {}, heads = {head}, genders = {}, inflections = {}}
if pos_functions[poscat] then
if pos_functions[poscat] then
pos_functions[poscat](class, parent_args, data)
pos_functions[poscat](class, args, data)
end
end

Navigation menu