45,660
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
local getArgs = require('Module:Arguments').getArgs | |||
local export = {} | local export = {} | ||
Line 10: | Line 12: | ||
-- 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 | local args = getArgs(frame) | ||
-- The part of speech. This is also the name of the category that | -- The part of speech. This is also the name of the category that | ||
Line 16: | Line 18: | ||
-- because you sometimes want something to behave as an adjective without | -- because you sometimes want something to behave as an adjective without | ||
-- putting it in the adjectives category. | -- putting it in the adjectives category. | ||
local poscat = | local poscat = args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.") | ||
local PAGENAME = mw.title.getCurrentTitle().text | local PAGENAME = mw.title.getCurrentTitle().text | ||
local head = args[ | local head = args[2] or PAGENAME | ||
if head == "" then | if head == "" then head = nil end | ||
--local data = {lang = lang, pos_category = (postype and postype .. " " or "") .. poscat, categories = {}, heads = {head}, genders = {}, inflections = {}} | --local data = {lang = lang, pos_category = (postype and postype .. " " or "") .. poscat, categories = {}, heads = {head}, genders = {}, inflections = {}} |