Difference between revisions 40001 and 40002 on test2wiki

-- This is a test of scribbling. Using Italian templates from en.wiktionary.
-- Owner SemperBlotto
local p = {}

function p.itadj(frame)
    local pframe = frame:getParent()
    local args = pframe.args
    local stem = args[1] or error("1st parameter (stem of adjective) missing!")
    local arg2end1 = args[2]
    local arg3 = args[3]
    local arg4 = args[4]
    local arg5 = args[5]
    local headword = "'''" .. stem
-- no ending vowel parameters - generate default
    if arg2end1 == nil then
            headword = "'''" .. stem .. "o''' ''m'' (''f'' [[" .. stem .. "a]], ''m plural'' "
            headword = headword .. "[[" .. stem .."i]], ''f plural'' [[" .. stem .. "e]])"
            return headword
        end
    local end2 = args[3] or error("Either 0, 2 or 4 vowel endings should be supplied!")
    local end3 = args[4]
-- 2 ending vowel parameters - m and f are identical
    if end3 == nil then
            headword = "'''" .. stem .. end1 .. "''' ''m and f'' ( ''m and f plural'' [["
            headword = headword .. stem .. end2 .. "]])"
            return headword
        end
        
    local end4 = args[5]
    
end

function p.itadv(frame)
    local pframe = frame:getParent()
    local config = frame.args
    local args = pframe.args
    local head = args["head"]
(contracted; show full)    local cat
    if sort ~= nil then cat = "[[category:Italian nouns|" .. sort .. "]]"
        else cat = "[[category:Italian nouns]]"
    end
    return headword .. cat
end

return p