48,355
edits
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 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 poscat = | local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.") | ||
local class = | 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, | pos_functions[poscat](class, args, data) | ||
end | end | ||