Difference between revisions 40038 and 40040 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 end1 = args[2] local headword = "'''" .. stem -- no ending vowel parameters - generate default if end1 == 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 -- 4 ending vowel parameters - specify exactly local end4 = args[5] or error("Either 0, 2 or 4 vowel endings should be supplied!") headword = "'''" .. stem .. end1 .. "''' ''m'' (''f'' [[" .. stem .. end2 .. "]], ''m plural'' [[" headword = headword .. stem .. end3 .. "]], ''f plural'', [[" .. stem .. end4 .. "]])" return headword end function p.itadv(frame) local pframe = frame:getParent() local config = frame.args local args = pframe.args local head = args["head"] local pagename = head or ("'''" .. config.pagename .. "'''") local sort = args["sort"] local cat if sort ~= nil then cat = "[[category:Italian adverbs|" .. sort .. "]]" else cat = "[[category:Italian adverbs]]" end return pagename .. cat end function p.itnoun(frame) local pframe = frame:getParent() local args = pframe.args local stem = args[1] or error("1st parameter (stem of noun) missing!") local gender = args[2] or error("2nd parameter (gender) missing!") local singular = args[3] or error("3rd parameter (singular ending) missing!") local plural = args[4] or error("4th parameter (plural ending) missing!") local headword = "'''" .. stem .. singular .. "''' ''" .. gender .. "'' (''plural'' [[" .. stem .. plural .. "]]" -- if masculine, test for added feminine (and similarly if feminine, test for added masculine) if gender == "m" then local f = args["f"] if f ~= nil then headword = headword .. ", ''feminine singular'' [[" .. f .."]]" end elseif gender == "f" then local m = args["m"] if m ~= nil then headword = headword .. ", ''masculine singular'' [[" .. m .."]]" end else error(gender .. " is an invalid gender.") end headword = headword .. ")" local sort = args["sort"] local cat if sort ~= nil then cat = "[[category:Italian nouns|" .. sort .. "]]" else cat = "[[category:Italian nouns]]" end return headword .. cat end function p.alts(x,y) -- For use within p.itconj function. -- Adds alternate forms to the main one with a comma in between. if y ~= nil then return x .. ", " .. y end return x end function p.itconj(frame) local pframe = frame:getParent() local args = pframe.args local inf = args["inf"] or error("Infinitive missing!") local aux = args["aux"] or "avere" local ger = args["ger"] local ger2 = args["ger2"] ger = p.alts(ger, ger2) local presp = args["presp"] local presp2 = args["presp2"] presp = p.alts(presp, presp2) local pastp = args["pastp"] local pastp2 = args["pastp2"]; local pastp3 = args["pastp3"]; local pastp3 = args["pastp3"]; local pastp4 = args["pastp4"] pastp = p.alts(pastp, pastp2) pastp = p.alts(pastp, pastp3) pastp = p.alts(pastp, pastp4) local conj = '<div class="NavFrame">\n' conj = conj .. '<div class="NavHead" align=left> Conjugation of ' .. inf .. '</div>\n' conj = conj .. '<div class="NavContent">\n' conj = conj .. '{| style="background:#F0F0F0;border-collapse:separate;border-spacing:2px" class="inflection-table"\n' conj = conj .. '|-\n' conj = conj .. '! colspan="1" style="background:#e2e4c0" | infinitive\n' conj = conj .. '| colspan="1" | ' .. inf .. '\n' conj = conj .. '|-\n' conj = conj .. '! colspan="2" style="background:#e2e4c0" | auxiliary verb\n' conj = conj .. '| colspan="1" | ' .. aux ..'\n' conj = conj .. '! colspan="2" style="background:#e2e4c0" | gerund\n' conj = conj .. '| colspan="2" | ' .. ger .. '\n' conj = conj .. '|-\n! colspan="2" style="background:#e2e4c0" | present participle\n' conj = conj .. '| colspan="1" | ' .. presp .. '\n' conj = conj .. '! colspan="2" style="background:#e2e4c0" | past participle\n' conj = conj .. '| colspan="2" | ' .. pastp .. '\n' conj = conj .. '|}</div></div>' return conj end return p All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://test2.wikipedia.org/w/index.php?diff=prev&oldid=40040.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|