Revision 40148 of "Module:It" 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.wiki(x)
-- For use within p.itconj function.
-- Wikifies term, converting nils to single spaces (for ease of concatenation).
if x == nil then return " " end
return "[[" .. x .. "]]"
end
function p.alts(x,y)
-- For use within p.itconj function.
-- Adds alternate forms with a comma in between.
if y ~= " " then return x .. ", " .. y end
return x
end
function p.itconj(frame)
-- This function builds pretty tables for Italian verb conjugation.
-- It is called by other templates/functions for regular verbs, and called directly for some irregular ones.
local pframe = frame:getParent()
local args = pframe.args
local inf = args["inf"] or error("Infinitive missing!")
local aux = args["aux"] or " "
-- Get all the inflected forms and their alternative forms (at least 1 alt each)
local ger = p.wiki(args["ger"])
local ger2 = p.wiki(args["ger2"])
ger = p.alts(ger, ger2)
local presp = p.wiki(args["presp"])
local presp2 = p.wiki(args["presp2"])
presp = p.alts(presp, presp2)
local pastp = p.wiki(args["pastp"])
local pastp2 = p.wiki(args["pastp2"]); local pastp3 = p.wiki(args["pastp3"]); local pastp3 = p.wiki(args["pastp3"]); local pastp4 = p.wiki(args["pastp4"])
pastp = p.alts(pastp, pastp2)
pastp = p.alts(pastp, pastp3)
pastp = p.alts(pastp, pastp4)
local pres1s = p.wiki(args["pres1s"]); local pres2s = p.wiki(args["pres2s"]); local pres3s = p.wiki(args["pres3s"])
local pres1p = p.wiki(args["pres1p"]); local pres2p = p.wiki(args["pres2p"]); local pres3p = p.wiki(args["pres3p"])
local pres1s2 = p.wiki(args["pres1s2"]); local pres2s2 = p.wiki(args["pres2s2"]); local pres3s2 = p.wiki(args["pres3s2"])
local pres1p2 = p.wiki(args["pres1p2"]); local pres2p2 = p.wiki(args["pres2p2"]); local pres3p2 = p.wiki(args["pres3p2"])
pres1s = p.alts(pres1s, pres1s2); pres2s = p.alts(pres2s, pres2s2); pres3s = p.alts(pres3s, pres3s2)
pres1p = p.alts(pres1p, pres1p2); pres2p = p.alts(pres2p, pres2p2); pres3p = p.alts(pres3p, pres3p2)
local imperf1s = p.wiki(args["imperf1s"]); local imperf2s = p.wiki(args["imperf2s"]); local imperf3s = p.wiki(args["imperf3s"])
local imperf1p = p.wiki(args["imperf1p"]); local imperf2p = p.wiki(args["imperf2p"]); local imperf3p = p.wiki(args["imperf3p"])
local imperf1s2 = p.wiki(args["imperf1s2"]); local imperf2s2 = p.wiki(args["imperf2s2"]); local imperf3s2 = p.wiki(args["imperf3s2"])
local imperf1p2 = p.wiki(args["imperf1p2"]); local imperf2p2 = p.wiki(args["imperf2p2"]); local imperf3p2 = p.wiki(args["imperf3p2"])
imperf1s = p.alts(imperf1s, imperf1s2); imperf2s = p.alts(imperf2s, imperf2s2); imperf3s = p.alts(imperf3s, imperf3s2)
imperf1p = p.alts(imperf1p, imperf1p2); imperf2p = p.alts(imperf2p, imperf2p2); imperf3p = p.alts(imperf3p, imperf3p2)
local prem1s = p.wiki(args["prem1s"]); local prem2s = p.wiki(args["prem2s"]); local prem3s = p.wiki(args["prem3s"])
local prem1p = p.wiki(args["prem1p"]); local prem2p = p.wiki(args["prem2p"]); local prem3p = p.wiki(args["prem3p"])
local prem1s2 = p.wiki(args["prem1s2"]); local prem2s2 = p.wiki(args["prem2s2"]); local prem3s2 = p.wiki(args["prem3s2"])
local prem1p2 = p.wiki(args["prem1p2"]); local prem2p2 = p.wiki(args["prem2p2"]); local prem3p2 = p.wiki(args["prem3p2"])
prem1s = p.alts(prem1s, prem1s2); prem2s = p.alts(prem2s, prem2s2); prem3s = p.alts(prem3s, prem3s2)
prem1p = p.alts(prem1p, prem1p2); prem2p = p.alts(prem2p, prem2p2); prem3p = p.alts(prem3p, prem3p2)
local fut1s = p.wiki(args["fut1s"]); local fut2s = p.wiki(args["fut2s"]); local fut3s = p.wiki(args["fut3s"])
local fut1p = p.wiki(args["fut1p"]); local fut2p = p.wiki(args["fut2p"]); local fut3p = p.wiki(args["fut3p"])
local fut1s2 = p.wiki(args["fut1s2"]); local fut2s2 = p.wiki(args["fut2s2"]); local fut3s2 = p.wiki(args["fut3s2"])
local fut1p2 = p.wiki(args["fut1p2"]); local fut2p2 = p.wiki(args["fut2p2"]); local fut3p2 = p.wiki(args["fut3p2"])
fut1s = p.alts(fut1s, fut1s2); fut2s = p.alts(fut2s, fut2s2); fut3s = p.alts(fut3s, fut3s2)
fut1p = p.alts(fut1p, fut1p2); fut2p = p.alts(fut2p, fut2p2); fut3p = p.alts(fut3p, fut3p2)
local cond1s = p.wiki(args["cond1s"]); local cond2s = p.wiki(args["cond2s"]); local cond3s = p.wiki(args["cond3s"])
local cond1p = p.wiki(args["cond1p"]); local cond2p = p.wiki(args["cond2p"]); local cond3p = p.wiki(args["cond3p"])
local cond1s2 = p.wiki(args["cond1s2"]); local cond2s2 = p.wiki(args["cond2s2"]); local cond3s2 = p.wiki(args["cond3s2"])
local cond1p2 = p.wiki(args["cond1p2"]); local cond2p2 = p.wiki(args["cond2p2"]); local cond3p2 = p.wiki(args["cond3p2"])
cond1s = p.alts(cond1s, cond1s2); cond2s = p.alts(cond2s, cond2s2); cond3s = p.alts(cond3s, cond3s2)
cond1p = p.alts(cond1p, cond1p2); cond2p = p.alts(cond2p, cond2p2); cond3p = p.alts(cond3p, cond3p2)
local sub123s = p.wiki(args["sub123s"]);local sub3s = p.wiki(args["sub3s"])
local sub1p = p.wiki(args["sub1p"]); local sub2p = p.wiki(args["sub2p"]); local sub3p = p.wiki(args["sub3p"])
local sub123s2 = p.wiki(args["sub123s2"]); local sub3s2 = p.wiki(args["sub3s2"])
local sub1p2 = p.wiki(args["sub1p2"]); local sub2p2 = p.wiki(args["sub2p2"]); local sub3p2 = p.wiki(args["sub3p2"])
sub123s = p.alts(sub123s, sub123s2); sub3s = p.alts(sub3s, sub3s2)
if sub3s == " " then sub3s = sub123s end
sub1p = p.alts(sub1p, sub1p2); sub2p = p.alts(sub2p, sub2p2); sub3p = p.alts(sub3p, sub3p2)
local impsub12s = p.wiki(args["impsub12s"]); local impsub3s = p.wiki(args["impsub3s"])
local impsub1p = p.wiki(args["impsub1p"]); local impsub2p = p.wiki(args["impsub2p"]); local impsub3p = p.wiki(args["impsub3p"])
local impsub12s2 = p.wiki(args["impsub12s2"]); local impsub3s2 = p.wiki(args["impsub3s2"])
local impsub1p2 = p.wiki(args["impsub1p2"]); local impsub2p2 = p.wiki(args["impsub2p2"]); local impsub3p2 = p.wiki(args["impsub3p2"])
impsub1s = p.alts(impsub12s, impsub12s2); impsub3s = p.alts(impsub3s, impsub3s2)
impsub1p = p.alts(impsub1p, impsub1p2); impsub2p = p.alts(impsub2p, impsub2p2); impsub3p = p.alts(impsub3p, impsub3p2)
local imp2s = p.wiki(args["imp2s"]); local imp3s = p.wiki(args["imp3s"])
local imp1p = p.wiki(args["imp1p"]); local imp2p = p.wiki(args["imp2p"]); local imp3p = p.wiki(args["imp3p"])
local imp2s2 = p.wiki(args["imp2s2"]); local imp3s2 = p.wiki(args["imp3s2"])
local imp1p2 = p.wiki(args["imp1p2"]); local imp2p2 = p.wiki(args["imp2p2"]); local imp3p2 = p.wiki(args["imp3p2"])
imp2s = p.alts(imp2s, imp2s2); imp3s = p.alts(imp3s, imp3s2)
imp1p = p.alts(imp1p, imp1p2); imp2p = p.alts(imp2p, imp2p2); imp3p = p.alts(imp3p, imp3p2)
-- See if reflexive
local mi = args["mi"] or " "; local ti = args["ti"] or " "; local si = args["si"] or " "; local ci = args["ci"] or " "; local vi = args["vi"] or " "
if mi ~= nil then mi = mi .. " "; ti = ti .." "; si = si .. " "; ci = ci .. " "; vi = vi .. " "; end
-- Start to build pretty table
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 .. '|-\n! colspan="1" rowspan="2" style="background:#C0C0C0" | person\n'
conj = conj .. '! colspan="3" style="background:#C0C0C0" | singular\n'
conj = conj .. '! colspan="3" style="background:#C0C0C0" | plural\n'
conj = conj .. '|-\n! style="background:#C0C0C0;width:12.5%" | first\n'
conj = conj .. '! style="background:#C0C0C0;width:12.5%" | second\n'
conj = conj .. '! style="background:#C0C0C0;width:12.5%" | third\n'
conj = conj .. '! style="background:#C0C0C0;width:12.5%" | first\n'
conj = conj .. '! style="background:#C0C0C0;width:12.5%" | second\n'
conj = conj .. '! style="background:#C0C0C0;width:12.5%" | third\n'
conj = conj .. '|-\n! style="background:#c0cfe4" colspan="1" | indicative\n'
conj = conj .. '! style="background:#c0cfe4" | io\n'
conj = conj .. '! style="background:#c0cfe4" | tu\n'
conj = conj .. '! style="background:#c0cfe4" | lui/lei\n'
conj = conj .. '! style="background:#c0cfe4" | noi\n'
conj = conj .. '! style="background:#c0cfe4" | voi\n'
conj = conj .. '! style="background:#c0cfe4" | essi/esse\n|-\n'
conj = conj .. '! style="height:3em;background:#c0cfe4" colspan="1" | present\n'
conj = conj .. '|' .. mi .. pres1s .. '\n|' .. ti .. pres2s .. '\n|' .. si .. pres3s .. '\n|' .. ci .. pres1p .. '\n|' .. vi .. pres2p .. '\n|' .. si .. pres3p .. '\n'
conj = conj .. '|-\n! style="height:3em;background:#c0cfe4" colspan="1" | imperfect\n'
conj = conj .. '|' .. mi .. imperf1s .. '\n|' .. ti .. imperf2s .. '\n|' .. si .. imperf3s .. '\n|' .. ci .. imperf1p .. '\n|' .. vi .. imperf2p .. '\n|' .. si .. imperf3p .. '\n'
conj = conj .. '|-\n! style="height:3em;background:#c0cfe4" colspan="1" | past historic\n'
conj = conj .. '|' .. mi .. prem1s .. '\n|' .. ti .. prem2s .. '\n|' .. si .. prem3s .. '\n|' .. ci .. prem1p .. '\n|' .. vi .. prem2p .. '\n|' .. si .. prem3p .. '\n'
conj = conj .. '|-\n! style="height:3em;background:#c0cfe4" colspan="1" | future\n'
conj = conj .. '|' .. mi .. fut1s .. '\n|' .. ti .. fut2s .. '\n|' .. si .. fut3s .. '\n|' .. ci .. fut1p .. '\n|' .. vi .. fut2p .. '\n|' .. si .. fut3p .. '\n'
conj = conj .. '|-\n! style="background:#c0d8e4" colspan="1" | conditional\n'
conj = conj .. '! style="background:#c0d8e4" | io\n'
conj = conj .. '! style="background:#c0d8e4" | tu\n'
conj = conj .. '! style="background:#c0d8e4" | lui/lei\n'
conj = conj .. '! style="background:#c0d8e4" | noi\n'
conj = conj .. '! style="background:#c0d8e4" | voi\n'
conj = conj .. '! style="background:#c0d8e4" | essi/esse\n'
conj = conj .. '|-\n! style="height:3em;background:#c0d8e4" colspan="1" | present\n'
conj = conj .. '|' .. mi .. cond1s .. '\n|' .. ti .. cond2s .. '\n|' .. si .. cond3s .. '\n|' .. ci .. cond1p .. '\n|' .. vi .. cond2p .. '\n|' .. si .. cond3p .. '\n'
conj = conj .. '|-\n! style="background:#c0e4c0" colspan="1" | subjunctive\n'
conj = conj .. '! style="background:#c0e4c0" | che io\n'
conj = conj .. '! style="background:#c0e4c0" | che tu\n'
conj = conj .. '! style="background:#c0e4c0" | che lui/che lei\n'
conj = conj .. '! style="background:#c0e4c0" | che noi\n'
conj = conj .. '! style="background:#c0e4c0" | che voi\n'
conj = conj .. '! style="background:#c0e4c0" | che essi/che esse\n|-\n'
conj = conj .. '! style="height:3em;background:#c0e4c0" | present\n'
conj = conj .. '|' .. mi .. sub123s .. '\n|' .. ti .. sub123s .. '\n|' .. si .. sub3s .. '\n|' .. ci .. sub1p .. '\n|' .. vi .. sub2p .. '\n|' .. si .. sub3p .. '\n'
conj = conj .. '|-\n! style="height:3em;background:#c0e4c0" rowspan="1" | imperfect\n'
conj = conj .. '|' .. mi .. impsub12s .. '\n|' .. ti .. impsub12s .. '\n|' .. si .. impsub3s .. '\n|' .. ci .. impsub1p .. '\n|' .. vi .. impsub2p .. '\n|' .. si .. impsub3p .. '\n'
conj = conj .. '|-\n! colspan="1" rowspan="2" style="height:3em;background:#e4d4c0" | imperative\n'
conj = conj .. '! style="background:#e4d4c0" | -\n'
conj = conj .. '! style="background:#e4d4c0" | tu\n'
conj = conj .. '! style="background:#e4d4c0" | lui/lei\n'
conj = conj .. '! style="background:#e4d4c0" | noi\n'
conj = conj .. '! style="background:#e4d4c0" | voi\n'
conj = conj .. '! style="background:#e4d4c0" | essi/esse\n'
conj = conj .. '|-\n|\n'
conj = conj .. '|' .. imp2s .. '\n|' .. imp3s .. '\n|' .. imp1p .. '\n|' .. imp2p .. '\n|' .. imp3p .. '\n'
conj = conj .. '|-\n'
conj = conj .. '|}</div></div>'
return conj
end
return pAll 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?oldid=40148.
![]() ![]() 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.
|