Mòdul:it-conj

De Viccionari
Icona de documentació de mòdul Documentació del mòdul[mostra] [modifica] [refresca]

A continuació es mostra la documentació transclosa de la subpàgina /ús. [salta a la caixa de codi]


Mòdul de suport per la plantilla {{it-conj}} per a generar la taula de conjugació d’un verb en italià. Vegeu la plantilla per al seu ús.

Addicionalment, amb el paràmetre bot=1, o qualsevol valor, genera una llista per a facilitar la lectura per un bot.

local p = {}

local m_links = require("Mòdul:enllaç")
local m_utilities = require("Mòdul:utilitats")
local lang = {code = "it", name = "italià", sc = "Latn"}

-- Functions that do the actual inflecting by creating the forms of a basic term.
local inflections = {}

local function extract_stem(inf)
	local stem, end_type
	if string.find(inf, "are$") then
		if string.find(inf, "[cg]are$") then
			stem = string.sub(inf, 1, -4)
			end_type = "care"
		elseif string.find(inf, "fare$") then
			stem = string.sub(inf, 1, -5)
			end_type = "fare"
		elseif string.find(inf, "[cg]iare$") then
			stem = string.sub(inf, 1, -5)
			end_type = "ciare"
		elseif string.find(inf, "iare$") then
			stem = string.sub(inf, 1, -4)
			end_type = "iare"
		else
			stem = string.sub(inf, 1, -4)
			end_type = "are"
		end
	elseif string.find(inf, "arsi$") then
		if string.find(inf, "[cg]arsi$") then
			stem = string.sub(inf, 1, -5)
			end_type = "carsi"
		elseif string.find(inf, "[cg]iarsi$") then
			stem = string.sub(inf, 1, -6)
			end_type = "ciarsi"
		elseif string.find(inf, "iarsi$") then
			stem = string.sub(inf, 1, -5)
			end_type = "iarsi"
		else
			stem = string.sub(inf, 1, -5)
			end_type = "arsi"
		end
	elseif string.find(inf, "ere$") then
		stem = string.sub(inf, 1, -4)
		end_type = "ere"
	elseif string.find(inf, "[eo]rsi$") then
		stem = string.sub(inf, 1, -5)
		if string.find(inf, "orsi$") then
			stem = stem .. "n"
		end
		end_type = "ersi"
	elseif string.find(inf, "[aou]rre$") then
		stem = string.sub(inf, 1, -5)
		end_type = "urre"
	elseif string.find(inf, "ire$") then
		stem = string.sub(inf, 1, -4)
		end_type = "ire"
	elseif string.find(inf, "[iu]rsi$") then
		stem = string.sub(inf, 1, -5)
		end_type = string.sub(inf, -4)
	end
	
	return stem, end_type
end

local function list_forms(forms)
	local ret = ''
	for key, form in pairs(forms) do
		local k = key
		for i, v in ipairs(form) do
			ret = ret .. "* " .. k .. "=" .. v .. "\n"
		end
	end
	return ret
end

local function add_compound_forms(data)
	data.forms.past_inf = {}
	data.forms.past_ger = {}
	for i, v in ipairs(data.forms.aux) do
		table.insert(data.forms.past_inf, "[[" .. v .. "]] [[" .. data.forms.past_ptc[1] .. "]]")
		if v == "avere" then
			table.insert(data.forms.past_ger, "[[avendo]] [[" .. data.forms.past_ptc[1] .. "]]")
		else
			table.insert(data.forms.past_ger, "[[essendo]] [[" .. data.forms.past_ptc[1] .. "]]")
		end
	end
end

-- Adds reflexive pronouns to the appropriate forms
local function add_reflexive_pronouns(args, data)
	-- Gather pronoun parameters
	local pronouns = {}
	
	pronouns["1sg"] = args["mi"] or ""; if pronouns["1sg"] == "" then pronouns["1sg"] = "mi" end
	pronouns["2sg"] = args["ti"] or ""; if pronouns["2sg"] == "" then pronouns["2sg"] = "ti" end
	pronouns["3sg"] = args["si"] or ""; if pronouns["3sg"] == "" then pronouns["3sg"] = "si" end
	pronouns["1pl"] = args["ci"] or ""; if pronouns["1pl"] == "" then pronouns["1pl"] = "ci" end
	pronouns["2pl"] = args["vi"] or ""; if pronouns["2pl"] == "" then pronouns["2pl"] = "vi" end
	pronouns["3pl"] = pronouns["3sg"]
	
	-- Go over all the forms in the list
	for key, subforms in pairs(data.forms) do
		-- Extract the person/number from the last 3 characters of the key
		local person = key:sub(-3)
		
		-- Skip these three, as they already had pronouns added earlier
		if pronouns[person] and key ~= "impr_2sg" and key ~= "impr_1pl" and key ~= "impr_2pl" then
			-- Go through each of the alternative subforms and add the pronoun
			for key2, subform in ipairs(subforms) do
				data.forms[key][key2] = pronouns[person] .. " [[" .. subform .. "]]"
			end
		end
	end
end

-- Main entry point
function p.itconj(frame)
	local args = frame:getParent().args
	pagename = args.pagename or mw.title.getCurrentTitle().subpageText
	
	-- Create the forms
	local data = {forms = {}, categories = {}, refl = false, stem = nil}
	
	local aux = mw.text.trim(args[1] or args.aux or "essere")
	if aux == "-" or aux == "—" then
		data.forms.aux = nil
	elseif aux == "avere o essere" then
		data.forms.aux = {"avere", "essere"}
	elseif aux == "essere o avere" then
		data.forms.aux = {"essere", "avere"}
	else
		data.forms.aux = {aux}
	end

	-- Find what type of verb is it (hard-coded in the template).
	-- Generate standard conjugated forms for each type of verb,
	local infl_type = args["para"]
	data.stem = args["rad"]
	
	if data.stem == nil or infl_type == nil then
		local stem, infl_t = extract_stem(args["inf"] or pagename)
		data.stem = data.stem or stem
		infl_type = infl_type or infl_t
	end
	
	if not infl_type then
		data.forms.infinitive = {args["inf"]}
		if data.forms.infinitive[1] == "" then data.forms.infinitive = nil end
	elseif inflections[infl_type] then
		inflections[infl_type](args, data)
	else
		error("El paradigme verbal " .. infl_type .. " no està contemplat.")
	end
	
	-- Get overridden forms
	process_overrides(args, data)
	
	-- Correct forms that are used in more than one person
	if not data.forms.pres_subj_1sg or #data.forms.pres_subj_1sg == 0 then data.forms.pres_subj_1sg = mw.clone(data.forms.pres_subj_123sg) end
	if not data.forms.pres_subj_2sg or #data.forms.pres_subj_2sg == 0 then data.forms.pres_subj_2sg = mw.clone(data.forms.pres_subj_123sg) end
	if not data.forms.pres_subj_3sg or #data.forms.pres_subj_3sg == 0 then data.forms.pres_subj_3sg = mw.clone(data.forms.pres_subj_123sg) end
	if data.forms.pres_subj_1sg and data.forms.pres_subj_2sg and data.forms.pres_subj_3sg then data.forms.pres_subj_123sg = nil end
	
	if not data.forms.impf_subj_1sg or #data.forms.impf_subj_1sg == 0 then data.forms.impf_subj_1sg = mw.clone(data.forms.impf_subj_12sg) end
	if not data.forms.impf_subj_2sg or #data.forms.impf_subj_2sg == 0 then data.forms.impf_subj_2sg = mw.clone(data.forms.impf_subj_12sg) end
	if data.forms.impf_subj_1sg and data.forms.impf_subj_2sg then data.forms.impf_subj_12sg = nil end
	
	if args.bot then
		return list_forms(data.forms)
	else
		add_compound_forms(data)
		-- Add reflexive pronouns
		if data.refl then
			add_reflexive_pronouns(args, data)
		end
	
		return make_table(data, args) .. m_utilities.format_categories(data.categories, lang)
	end
end

-- Replaces terms with overridden ones that are given as additional named parameters.
function process_overrides(args, data)
	-- Each term in current is overridden by one in override, if it exists.
	local function override(current, override)
		current = current or {}
		local ret = {}
		
		local i = 1
		
		-- First see if any of the existing items in current have an override specified.
		while current[i] do
			if override[i] and override[i] ~= "" then
				if override[i] ~= "''" and override[i] ~= "-" then
					table.insert(ret, override[i])
				elseif override[i] == "''" then
					table.insert(data.categories, "it-conj with quotes in override")
				end
			else
				table.insert(ret, current[i])
			end
			
			i = i + 1
		end
		
		-- We've reached the end of current.
		-- Look in the override list to see if there are any extra forms to add on to the end.
		while override[i] do
			if override[i] and override[i] ~= "" and override[i] ~= "''" and override[i] ~= "-" then
				table.insert(ret, override[i])
			elseif override[i] == "''" then
				table.insert(data.categories, "it-conj with quotes in override")
			end
			
			i = i + 1
		end
		
		return ret
	end
	
	-- Mark terms with any additional statement as irregular.
	for k, v in pairs(args) do
		if k ~= 1 and k ~= "para" and k ~= "rad" and k ~= "aux" and k ~= "inf" and mw.text.trim(v) ~= '' then
			table.insert(data.categories, 'Verbs irregulars en italià')
			if not string.find(data.title, "irregular") then
				data.title = data.title .. ", irregular"
			end
			break
		end
	end
	
	-- Mark terms with irregular past participles
	--if args['pastp'] and args['pastp'] ~= '' and not data.refl  then
	--	table.insert(data.categories, 'Verbs en italià amb participi irregular')
	--end

	-- Non-finite forms
	data.forms.infinitive = override(data.forms.infinitive, {args["inf"]})
	data.forms.gerund = override(data.forms.gerund, {args["ger"], args["ger2"]})
	data.forms.pres_ptc = override(data.forms.pres_ptc, {args["presp"], args["presp2"]})
	data.forms.past_ptc = override(data.forms.past_ptc, {args["pastp"], args["pastp2"], args["pastp3"], args["pastp4"]})
	
	-- Present
	data.forms.pres_indc_1sg = override(data.forms.pres_indc_1sg, {args["pres1s"], args["pres1s2"], args["pres1s3"]})
	data.forms.pres_indc_2sg = override(data.forms.pres_indc_2sg, {args["pres2s"], args["pres2s2"]})
	data.forms.pres_indc_3sg = override(data.forms.pres_indc_3sg, {args["pres3s"], args["pres3s2"]})
	data.forms.pres_indc_1pl = override(data.forms.pres_indc_1pl, {args["pres1p"], args["pres1p2"]})
	data.forms.pres_indc_2pl = override(data.forms.pres_indc_2pl, {args["pres2p"], args["pres2p2"]})
	data.forms.pres_indc_3pl = override(data.forms.pres_indc_3pl, {args["pres3p"], args["pres3p2"]})
	
	-- Imperfect
	data.forms.impf_indc_1sg = override(data.forms.impf_indc_1sg, {args["imperf1s"], args["imperf1s2"]})
	data.forms.impf_indc_2sg = override(data.forms.impf_indc_2sg, {args["imperf2s"], args["imperf2s2"]})
	data.forms.impf_indc_3sg = override(data.forms.impf_indc_3sg, {args["imperf3s"], args["imperf3s2"]})
	data.forms.impf_indc_1pl = override(data.forms.impf_indc_1pl, {args["imperf1p"], args["imperf1p2"]})
	data.forms.impf_indc_2pl = override(data.forms.impf_indc_2pl, {args["imperf2p"], args["imperf2p2"]})
	data.forms.impf_indc_3pl = override(data.forms.impf_indc_3pl, {args["imperf3p"], args["imperf3p2"]})
	
	-- Past historic
	data.forms.phis_indc_1sg = override(data.forms.phis_indc_1sg, {args["prem1s"], args["prem1s2"], args["prem1s3"]})
	data.forms.phis_indc_2sg = override(data.forms.phis_indc_2sg, {args["prem2s"], args["prem2s2"]})
	data.forms.phis_indc_3sg = override(data.forms.phis_indc_3sg, {args["prem3s"], args["prem3s2"], args["prem3s3"]})
	data.forms.phis_indc_1pl = override(data.forms.phis_indc_1pl, {args["prem1p"], args["prem1p2"]})
	data.forms.phis_indc_2pl = override(data.forms.phis_indc_2pl, {args["prem2p"], args["prem2p2"]})
	data.forms.phis_indc_3pl = override(data.forms.phis_indc_3pl, {args["prem3p"], args["prem3p2"], args["prem3p3"]})
	
	-- Future
	data.forms.futr_indc_1sg = override(data.forms.futr_indc_1sg, {args["fut1s"], args["fut1s2"]})
	data.forms.futr_indc_2sg = override(data.forms.futr_indc_2sg, {args["fut2s"], args["fut2s2"]})
	data.forms.futr_indc_3sg = override(data.forms.futr_indc_3sg, {args["fut3s"], args["fut3s2"]})
	data.forms.futr_indc_1pl = override(data.forms.futr_indc_1pl, {args["fut1p"], args["fut1p2"]})
	data.forms.futr_indc_2pl = override(data.forms.futr_indc_2pl, {args["fut2p"], args["fut2p2"]})
	data.forms.futr_indc_3pl = override(data.forms.futr_indc_3pl, {args["fut3p"], args["fut3p2"]})
	
	-- Conditional
	data.forms.cond_1sg = override(data.forms.cond_1sg, {args["cond1s"], args["cond1s2"]})
	data.forms.cond_2sg = override(data.forms.cond_2sg, {args["cond2s"], args["cond2s2"]})
	data.forms.cond_3sg = override(data.forms.cond_3sg, {args["cond3s"], args["cond3s2"]})
	data.forms.cond_1pl = override(data.forms.cond_1pl, {args["cond1p"], args["cond1p2"]})
	data.forms.cond_2pl = override(data.forms.cond_2pl, {args["cond2p"], args["cond2p2"]})
	data.forms.cond_3pl = override(data.forms.cond_3pl, {args["cond3p"], args["cond3p2"]})
	
	-- Present subjunctive
	data.forms.pres_subj_123sg = override(data.forms.pres_subj_123sg, {args["sub123s"], args["sub123s2"]})
	data.forms.pres_subj_3sg = override(data.forms.pres_subj_3sg, {args["sub3s"], args["sub3s2"]})
	data.forms.pres_subj_1pl = override(data.forms.pres_subj_1pl, {args["sub1p"], args["sub1p2"]})
	data.forms.pres_subj_2pl = override(data.forms.pres_subj_2pl, {args["sub2p"], args["sub2p2"]})
	data.forms.pres_subj_3pl = override(data.forms.pres_subj_3pl, {args["sub3p"], args["sub3p2"]})
	
	-- Imperfect subjunctive
	data.forms.impf_subj_12sg = override(data.forms.impf_subj_12sg, {args["impsub12s"], args["impsub12s2"]})
	data.forms.impf_subj_3sg = override(data.forms.impf_subj_3sg, {args["impsub3s"], args["impsub3s2"]})
	data.forms.impf_subj_1pl = override(data.forms.impf_subj_1pl, {args["impsub1p"], args["impsub1p2"]})
	data.forms.impf_subj_2pl = override(data.forms.impf_subj_2pl, {args["impsub2p"], args["impsub2p2"]})
	data.forms.impf_subj_3pl = override(data.forms.impf_subj_3pl, {args["impsub3p"], args["impsub3p2"]})
	
	-- Imperative
	data.forms.impr_2sg = override(data.forms.impr_2sg, {args["imp2s"], args["imp2s2"], args["imp2s3"], args["imp2s4"]})
	data.forms.impr_3sg = override(data.forms.impr_3sg, {args["imp3s"], args["imp3s2"]})
	data.forms.impr_1pl = override(data.forms.impr_1pl, {args["imp1p"], args["imp1p2"]})
	data.forms.impr_2pl = override(data.forms.impr_2pl, {args["imp2p"], args["imp2p2"]})
	data.forms.impr_3pl = override(data.forms.impr_3pl, {args["imp3p"], args["imp3p2"]})
end

-- Inflection functions

inflections["are"] = function(args, data)
	local stem = data.stem
	data.title = "Primera conjugació tema ''a'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "are"}
	data.forms.gerund = {stem .. "ando"}
	data.forms.pres_ptc = {stem .. "ante"}
	data.forms.past_ptc = {stem .. "ato"}
	
	data.forms.pres_indc_1sg = {stem .. "o"}
	data.forms.pres_indc_2sg = {stem .. "i"}
	data.forms.pres_indc_3sg = {stem .. "a"}
	data.forms.pres_indc_1pl = {stem .. "iamo"}
	data.forms.pres_indc_2pl = {stem .. "ate"}
	data.forms.pres_indc_3pl = {stem .. "ano"}
	
	data.forms.impf_indc_1sg = {stem .. "avo"}
	data.forms.impf_indc_2sg = {stem .. "avi"}
	data.forms.impf_indc_3sg = {stem .. "ava"}
	data.forms.impf_indc_1pl = {stem .. "avamo"}
	data.forms.impf_indc_2pl = {stem .. "avate"}
	data.forms.impf_indc_3pl = {stem .. "avano"}
	
	data.forms.phis_indc_1sg = {stem .. "ai"}
	data.forms.phis_indc_2sg = {stem .. "asti"}
	data.forms.phis_indc_3sg = {stem .. "ò"}
	data.forms.phis_indc_1pl = {stem .. "ammo"}
	data.forms.phis_indc_2pl = {stem .. "aste"}
	data.forms.phis_indc_3pl = {stem .. "arono"}
	
	data.forms.futr_indc_1sg = {stem .. "erò"}
	data.forms.futr_indc_2sg = {stem .. "erai"}
	data.forms.futr_indc_3sg = {stem .. "erà"}
	data.forms.futr_indc_1pl = {stem .. "eremo"}
	data.forms.futr_indc_2pl = {stem .. "erete"}
	data.forms.futr_indc_3pl = {stem .. "eranno"}
	
	data.forms.cond_1sg = {stem .. "erei"}
	data.forms.cond_2sg = {stem .. "eresti"}
	data.forms.cond_3sg = {stem .. "erebbe"}
	data.forms.cond_1pl = {stem .. "eremmo"}
	data.forms.cond_2pl = {stem .. "ereste"}
	data.forms.cond_3pl = {stem .. "erebbero"}
	
	data.forms.pres_subj_123sg = {stem .. "i"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "iamo"}
	data.forms.pres_subj_2pl = {stem .. "iate"}
	data.forms.pres_subj_3pl = {stem .. "ino"}
	
	data.forms.impf_subj_12sg = {stem .. "assi"}
	data.forms.impf_subj_3sg = {stem .. "asse"}
	data.forms.impf_subj_1pl = {stem .. "assimo"}
	data.forms.impf_subj_2pl = {stem .. "aste"}
	data.forms.impf_subj_3pl = {stem .. "assero"}
	
	data.forms.impr_2sg = {stem .. "a", "non [[" .. stem .. "are]]"}
	data.forms.impr_3sg = {stem .. "i"}
	data.forms.impr_1pl = {stem .. "iamo"}
	data.forms.impr_2pl = {stem .. "ate"}
	data.forms.impr_3pl = {stem .. "ino"}
end

inflections["arsi"] = function(args, data)
	inflections["are"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "arsi"}
	data.forms.gerund = {stem .. "andosi"}
	data.forms.pres_ptc = {stem .. "antesi"}
	table.insert(data.forms.past_ptc, stem .. "atosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "atene", "non te ne [[" .. stem .. "are]]", "non [[" .. stem .. "artene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "atela", "non te la [[" .. stem .. "are]]", "non [[" .. stem .. "artela]]"}
	else
		data.forms.impr_2sg = {stem .. "ati", "non ti [[" .. stem .. "are]]", "non [[" .. stem .. "arti]]"}
	end	
	data.forms.impr_1pl = {stem .. "iamoci"}
	data.forms.impr_2pl = {stem .. "atevi"}
end

inflections["care"] = function(args, data)
	local stem = data.stem
	data.title = "Primera conjugació tema ''a'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "are"}
	data.forms.gerund = {stem .. "ando"}
	data.forms.pres_ptc = {stem .. "ante"}
	data.forms.past_ptc = {stem .. "ato"}
	
	data.forms.pres_indc_1sg = {stem .. "o"}
	data.forms.pres_indc_2sg = {stem .. "hi"}
	data.forms.pres_indc_3sg = {stem .. "a"}
	data.forms.pres_indc_1pl = {stem .. "hiamo"}
	data.forms.pres_indc_2pl = {stem .. "ate"}
	data.forms.pres_indc_3pl = {stem .. "ano"}
	
	data.forms.impf_indc_1sg = {stem .. "avo"}
	data.forms.impf_indc_2sg = {stem .. "avi"}
	data.forms.impf_indc_3sg = {stem .. "ava"}
	data.forms.impf_indc_1pl = {stem .. "avamo"}
	data.forms.impf_indc_2pl = {stem .. "avate"}
	data.forms.impf_indc_3pl = {stem .. "avano"}
	
	data.forms.phis_indc_1sg = {stem .. "ai"}
	data.forms.phis_indc_2sg = {stem .. "asti"}
	data.forms.phis_indc_3sg = {stem .. "ò"}
	data.forms.phis_indc_1pl = {stem .. "ammo"}
	data.forms.phis_indc_2pl = {stem .. "aste"}
	data.forms.phis_indc_3pl = {stem .. "arono"}
	
	data.forms.futr_indc_1sg = {stem .. "herò"}
	data.forms.futr_indc_2sg = {stem .. "herai"}
	data.forms.futr_indc_3sg = {stem .. "herà"}
	data.forms.futr_indc_1pl = {stem .. "heremo"}
	data.forms.futr_indc_2pl = {stem .. "herete"}
	data.forms.futr_indc_3pl = {stem .. "heranno"}
	
	data.forms.cond_1sg = {stem .. "herei"}
	data.forms.cond_2sg = {stem .. "heresti"}
	data.forms.cond_3sg = {stem .. "herebbe"}
	data.forms.cond_1pl = {stem .. "heremmo"}
	data.forms.cond_2pl = {stem .. "hereste"}
	data.forms.cond_3pl = {stem .. "herebbero"}
	
	data.forms.pres_subj_123sg = {stem .. "hi"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "hiamo"}
	data.forms.pres_subj_2pl = {stem .. "hiate"}
	data.forms.pres_subj_3pl = {stem .. "hino"}
	
	data.forms.impf_subj_12sg = {stem .. "assi"}
	data.forms.impf_subj_3sg = {stem .. "asse"}
	data.forms.impf_subj_1pl = {stem .. "assimo"}
	data.forms.impf_subj_2pl = {stem .. "aste"}
	data.forms.impf_subj_3pl = {stem .. "assero"}
	
	data.forms.impr_2sg = {stem .. "a", "non [[" .. stem .. "are]]"}
	data.forms.impr_3sg = {stem .. "hi"}
	data.forms.impr_1pl = {stem .. "hiamo"}
	data.forms.impr_2pl = {stem .. "ate"}
	data.forms.impr_3pl = {stem .. "hino"}
end

inflections["carsi"] = function(args, data)
	inflections["care"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "arsi"}
	data.forms.gerund = {stem .. "andosi"}
	data.forms.pres_ptc = {stem .. "antesi"}
	table.insert(data.forms.past_ptc, stem .. "atosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "atene", "non te ne [[" .. stem .. "are]]", "non [[" .. stem .. "artene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "atela", "non te la [[" .. stem .. "are]]", "non [[" .. stem .. "artela]]"}
	else
		data.forms.impr_2sg = {stem .. "ati", "non ti [[" .. stem .. "are]]", "non [[" .. stem .. "arti]]"}
	end	
	data.forms.impr_1pl = {stem .. "hiamoci"}
	data.forms.impr_2pl = {stem .. "atevi"}
end

inflections["iare"] = function(args, data)
	local stem = data.stem
	data.title = "Primera conjugació tema ''a'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "are"}
	data.forms.gerund = {stem .. "ando"}
	data.forms.pres_ptc = {stem .. "ante"}
	data.forms.past_ptc = {stem .. "ato"}
	
	data.forms.pres_indc_1sg = {stem .. "o"}
	data.forms.pres_indc_2sg = {stem}
	data.forms.pres_indc_3sg = {stem .. "a"}
	data.forms.pres_indc_1pl = {stem .. "amo"}
	data.forms.pres_indc_2pl = {stem .. "ate"}
	data.forms.pres_indc_3pl = {stem .. "ano"}
	
	data.forms.impf_indc_1sg = {stem .. "avo"}
	data.forms.impf_indc_2sg = {stem .. "avi"}
	data.forms.impf_indc_3sg = {stem .. "ava"}
	data.forms.impf_indc_1pl = {stem .. "avamo"}
	data.forms.impf_indc_2pl = {stem .. "avate"}
	data.forms.impf_indc_3pl = {stem .. "avano"}
	
	data.forms.phis_indc_1sg = {stem .. "ai"}
	data.forms.phis_indc_2sg = {stem .. "asti"}
	data.forms.phis_indc_3sg = {stem .. "ò"}
	data.forms.phis_indc_1pl = {stem .. "ammo"}
	data.forms.phis_indc_2pl = {stem .. "aste"}
	data.forms.phis_indc_3pl = {stem .. "arono"}
	
	data.forms.futr_indc_1sg = {stem .. "erò"}
	data.forms.futr_indc_2sg = {stem .. "erai"}
	data.forms.futr_indc_3sg = {stem .. "erà"}
	data.forms.futr_indc_1pl = {stem .. "eremo"}
	data.forms.futr_indc_2pl = {stem .. "erete"}
	data.forms.futr_indc_3pl = {stem .. "eranno"}
	
	data.forms.cond_1sg = {stem .. "erei"}
	data.forms.cond_2sg = {stem .. "eresti"}
	data.forms.cond_3sg = {stem .. "erebbe"}
	data.forms.cond_1pl = {stem .. "eremmo"}
	data.forms.cond_2pl = {stem .. "ereste"}
	data.forms.cond_3pl = {stem .. "erebbero"}
	
	data.forms.pres_subj_123sg = {stem}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "amo"}
	data.forms.pres_subj_2pl = {stem .. "ate"}
	data.forms.pres_subj_3pl = {stem .. "no"}
	
	data.forms.impf_subj_12sg = {stem .. "assi"}
	data.forms.impf_subj_3sg = {stem .. "asse"}
	data.forms.impf_subj_1pl = {stem .. "assimo"}
	data.forms.impf_subj_2pl = {stem .. "aste"}
	data.forms.impf_subj_3pl = {stem .. "assero"}
	
	data.forms.impr_2sg = {stem .. "a", "non [[" .. stem .. "are]]"}
	data.forms.impr_3sg = {stem}
	data.forms.impr_1pl = {stem .. "amo"}
	data.forms.impr_2pl = {stem .. "ate"}
	data.forms.impr_3pl = {stem .. "no"}
end

inflections["iarsi"] = function(args, data)
	inflections["iare"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "arsi"}
	data.forms.gerund = {stem .. "andosi"}
	data.forms.pres_ptc = {stem .. "antesi"}
	table.insert(data.forms.past_ptc, stem .. "atosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "atene", "non te ne [[" .. stem .. "are]]", "non [[" .. stem .. "artene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "atela", "non te la [[" .. stem .. "are]]", "non [[" .. stem .. "artela]]"}
	else
		data.forms.impr_2sg = {stem .. "ati", "non ti [[" .. stem .. "are]]", "non [[" .. stem .. "arti]]"}
	end	
	data.forms.impr_1pl = {stem .. "amoci"}
	data.forms.impr_2pl = {stem .. "atevi"}
end

inflections["ciare"] = function(args, data)
	local stem = data.stem
	data.title = "Primera conjugació tema ''a'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "iare"}
	data.forms.gerund = {stem .. "iando"}
	data.forms.pres_ptc = {stem .. "iante"}
	data.forms.past_ptc = {stem .. "iato"}
	
	data.forms.pres_indc_1sg = {stem .. "io"}
	data.forms.pres_indc_2sg = {stem .. "i"}
	data.forms.pres_indc_3sg = {stem .. "ia"}
	data.forms.pres_indc_1pl = {stem .. "iamo"}
	data.forms.pres_indc_2pl = {stem .. "iate"}
	data.forms.pres_indc_3pl = {stem .. "iano"}
	
	data.forms.impf_indc_1sg = {stem .. "iavo"}
	data.forms.impf_indc_2sg = {stem .. "iavi"}
	data.forms.impf_indc_3sg = {stem .. "iava"}
	data.forms.impf_indc_1pl = {stem .. "iavamo"}
	data.forms.impf_indc_2pl = {stem .. "iavate"}
	data.forms.impf_indc_3pl = {stem .. "iavano"}
	
	data.forms.phis_indc_1sg = {stem .. "iai"}
	data.forms.phis_indc_2sg = {stem .. "iasti"}
	data.forms.phis_indc_3sg = {stem .. "iò"}
	data.forms.phis_indc_1pl = {stem .. "iammo"}
	data.forms.phis_indc_2pl = {stem .. "iaste"}
	data.forms.phis_indc_3pl = {stem .. "iarono"}
	
	data.forms.futr_indc_1sg = {stem .. "erò"}
	data.forms.futr_indc_2sg = {stem .. "erai"}
	data.forms.futr_indc_3sg = {stem .. "erà"}
	data.forms.futr_indc_1pl = {stem .. "eremo"}
	data.forms.futr_indc_2pl = {stem .. "erete"}
	data.forms.futr_indc_3pl = {stem .. "eranno"} 
	
	data.forms.cond_1sg = {stem .. "erei"}
	data.forms.cond_2sg = {stem .. "eresti"}
	data.forms.cond_3sg = {stem .. "erebbe"}
	data.forms.cond_1pl = {stem .. "eremmo"}
	data.forms.cond_2pl = {stem .. "ereste"}
	data.forms.cond_3pl = {stem .. "erebbero"}
	
	data.forms.pres_subj_123sg = {stem .. "i"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "iamo"}
	data.forms.pres_subj_2pl = {stem .. "iate"}
	data.forms.pres_subj_3pl = {stem .. "ino"}
	
	data.forms.impf_subj_12sg = {stem .. "iassi"}
	data.forms.impf_subj_3sg = {stem .. "iasse"}
	data.forms.impf_subj_1pl = {stem .. "iassimo"}
	data.forms.impf_subj_2pl = {stem .. "iaste"}
	data.forms.impf_subj_3pl = {stem .. "iassero"}
	
	data.forms.impr_2sg = {stem .. "ia", "non [[" .. stem .. "iare]]"}
	data.forms.impr_3sg = {stem .. "i"}
	data.forms.impr_1pl = {stem .. "iamo"}
	data.forms.impr_2pl = {stem .. "iate"}
	data.forms.impr_3pl = {stem .. "ino"}
end

inflections["ciarsi"] = function(args, data)
	inflections["ciare"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "iarsi"}
	data.forms.gerund = {stem .. "iandosi"}
	data.forms.pres_ptc = {stem .. "iantesi"}
	table.insert(data.forms.past_ptc, stem .. "iatosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "iatene", "non te ne [[" .. stem .. "iare]]", "non [[" .. stem .. "iartene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "iatela", "non te la [[" .. stem .. "iare]]", "non [[" .. stem .. "iartela]]"}
	else
		data.forms.impr_2sg = {stem .. "iati", "non ti [[" .. stem .. "iare]]", "non [[" .. stem .. "iarti]]"}
	end	
	data.forms.impr_1pl = {stem .. "iamoci"}
	data.forms.impr_2pl = {stem .. "iatevi"}
end

inflections["ere"] = function(args, data)
	local stem = data.stem
	data.title = "Segona conjugació tema ''e'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "ere"}
	data.forms.gerund = {stem .. "endo"}
	data.forms.pres_ptc = {stem .. "ente"}
	data.forms.past_ptc = {stem .. "uto"}
	
	data.forms.pres_indc_1sg = {stem .. "o"}
	data.forms.pres_indc_2sg = {stem .. "i"}
	data.forms.pres_indc_3sg = {stem .. "e"}
	data.forms.pres_indc_1pl = {stem .. "iamo"}
	data.forms.pres_indc_2pl = {stem .. "ete"}
	data.forms.pres_indc_3pl = {stem .. "ono"}
	
	data.forms.impf_indc_1sg = {stem .. "evo"}
	data.forms.impf_indc_2sg = {stem .. "evi"}
	data.forms.impf_indc_3sg = {stem .. "eva"}
	data.forms.impf_indc_1pl = {stem .. "evamo"}
	data.forms.impf_indc_2pl = {stem .. "evate"}
	data.forms.impf_indc_3pl = {stem .. "evano"}
	
	data.forms.phis_indc_1sg = {stem .. "ei"}
	data.forms.phis_indc_2sg = {stem .. "esti"}
	data.forms.phis_indc_3sg = {stem .. "ette", stem .. "é"}
	data.forms.phis_indc_1pl = {stem .. "emmo"}
	data.forms.phis_indc_2pl = {stem .. "este"}
	data.forms.phis_indc_3pl = {stem .. "ettero", stem .. "erono"}
	
	data.forms.futr_indc_1sg = {stem .. "erò"}
	data.forms.futr_indc_2sg = {stem .. "erai"}
	data.forms.futr_indc_3sg = {stem .. "erà"}
	data.forms.futr_indc_1pl = {stem .. "eremo"}
	data.forms.futr_indc_2pl = {stem .. "erete"}
	data.forms.futr_indc_3pl = {stem .. "eranno"}
	
	data.forms.cond_1sg = {stem .. "erei"}
	data.forms.cond_2sg = {stem .. "eresti"}
	data.forms.cond_3sg = {stem .. "erebbe"}
	data.forms.cond_1pl = {stem .. "eremmo"}
	data.forms.cond_2pl = {stem .. "ereste"}
	data.forms.cond_3pl = {stem .. "erebbero"}
	
	data.forms.pres_subj_123sg = {stem .. "a"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "iamo"}
	data.forms.pres_subj_2pl = {stem .. "iate"}
	data.forms.pres_subj_3pl = {stem .. "ano"}
	
	data.forms.impf_subj_12sg = {stem .. "essi"}
	data.forms.impf_subj_3sg = {stem .. "esse"}
	data.forms.impf_subj_1pl = {stem .. "essimo"}
	data.forms.impf_subj_2pl = {stem .. "este"}
	data.forms.impf_subj_3pl = {stem .. "essero"}
	
	if mw.ustring.match(stem, "a$") then
		data.forms.impr_2sg = {stem .. "i", "non [[" .. stem .. "rre]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "orre$") then
		data.forms.impr_2sg = {stem .. "i", "non [[" .. args["inf"] .. "]]"}
	else
		data.forms.impr_2sg = {stem .. "i", "non [[" .. stem .. "ere]]"}
	end	
	
	data.forms.impr_3sg = {stem .. "a"}
	data.forms.impr_1pl = {stem .. "iamo"}
	data.forms.impr_2pl = {stem .. "ete"}
	data.forms.impr_3pl = {stem .. "ano"}
end

inflections["ersi"] = function(args, data)
	inflections["ere"](args, data)
	
	local stem = data.stem
	local stem2 = ""
	data.refl = true
	
	data.forms.infinitive = {stem .. "ersi"}
	data.forms.gerund = {stem .. "endosi"}
	data.forms.pres_ptc = {stem .. "entesi"}
	table.insert(data.forms.past_ptc, stem .. "utosi")
	if mw.ustring.match(stem, "a$") then
		if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
			data.forms.impr_2sg = {stem .. "itene", "non te ne [[" .. stem .. "rre]]", "non [[" .. stem .. "rtene]]"}
		elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
			data.forms.impr_2sg = {stem .. "itela", "non te la [[" .. stem .. "rre]]", "non [[" .. stem .. "rtela]]"}
		else
			data.forms.impr_2sg = {stem .. "i", "non ti [[" .. stem .. "rre]]", "non [[" .. stem .. "rti]]"}
		end	
	elseif args["inf"] and mw.ustring.match(args["inf"], "orsi$") then
		stem2 = stem:gsub("(n)$", {["n"] = "r"})
		if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
			data.forms.impr_2sg = {stem .. "itene", "non te ne [[" .. stem2 .. "re]]", "non [[" .. stem2 .. "tene]]"}
		elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
			data.forms.impr_2sg = {stem .. "itela", "non te la [[" .. stem2 .. "re]]", "non [[" .. stem2 .. "tela]]"}
		else
			data.forms.impr_2sg = {stem .. "i", "non ti [[" .. stem2 .. "re]]", "non [[" .. stem2 .. "ti]]"}
		end	
	else
		if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
			data.forms.impr_2sg = {stem .. "itene", "non te ne [[" .. stem .. "ere]]", "non [[" .. stem .. "ertene]]"}
		elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
			data.forms.impr_2sg = {stem .. "itela", "non te la [[" .. stem .. "ere]]", "non [[" .. stem .. "ertela]]"}
		else
			data.forms.impr_2sg = {stem .. "iti", "non ti [[" .. stem .. "ere]]", "non [[" .. stem .. "erti]]"}
		end	
	end	
	data.forms.impr_1pl = {stem .. "iamoci"}
	data.forms.impr_2pl = {stem .. "etevi"}
end

inflections["ire"] = function(args, data)
	local stem = data.stem
	data.title = "Tercera conjugació tema ''i'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "ire"}
	data.forms.gerund = {stem .. "endo"}
	data.forms.pres_ptc = {stem .. "ente"}
	data.forms.past_ptc = {stem .. "ito"}
	
	data.forms.pres_indc_1sg = {stem .. "o"}
	data.forms.pres_indc_2sg = {stem .. "i"}
	data.forms.pres_indc_3sg = {stem .. "e"}
	data.forms.pres_indc_1pl = {stem .. "iamo"}
	data.forms.pres_indc_2pl = {stem .. "ite"}
	data.forms.pres_indc_3pl = {stem .. "ono"}
	
	data.forms.impf_indc_1sg = {stem .. "ivo"}
	data.forms.impf_indc_2sg = {stem .. "ivi"}
	data.forms.impf_indc_3sg = {stem .. "iva"}
	data.forms.impf_indc_1pl = {stem .. "ivamo"}
	data.forms.impf_indc_2pl = {stem .. "ivate"}
	data.forms.impf_indc_3pl = {stem .. "ivano"}
	
	data.forms.phis_indc_1sg = {stem .. "ii"}
	data.forms.phis_indc_2sg = {stem .. "isti"}
	data.forms.phis_indc_3sg = {stem .. "ì"}
	data.forms.phis_indc_1pl = {stem .. "immo"}
	data.forms.phis_indc_2pl = {stem .. "iste"}
	data.forms.phis_indc_3pl = {stem .. "irono"}
	
	data.forms.futr_indc_1sg = {stem .. "irò"}
	data.forms.futr_indc_2sg = {stem .. "irai"}
	data.forms.futr_indc_3sg = {stem .. "irà"}
	data.forms.futr_indc_1pl = {stem .. "iremo"}
	data.forms.futr_indc_2pl = {stem .. "irete"}
	data.forms.futr_indc_3pl = {stem .. "iranno"}
	
	data.forms.cond_1sg = {stem .. "irei"}
	data.forms.cond_2sg = {stem .. "iresti"}
	data.forms.cond_3sg = {stem .. "irebbe"}
	data.forms.cond_1pl = {stem .. "iremmo"}
	data.forms.cond_2pl = {stem .. "ireste"}
	data.forms.cond_3pl = {stem .. "irebbero"}
	
	data.forms.pres_subj_123sg = {stem .. "a"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "iamo"}
	data.forms.pres_subj_2pl = {stem .. "iate"}
	data.forms.pres_subj_3pl = {stem .. "ano"}
	
	data.forms.impf_subj_12sg = {stem .. "issi"}
	data.forms.impf_subj_3sg = {stem .. "isse"}
	data.forms.impf_subj_1pl = {stem .. "issimo"}
	data.forms.impf_subj_2pl = {stem .. "iste"}
	data.forms.impf_subj_3pl = {stem .. "issero"}
	
	data.forms.impr_2sg = {stem .. "i", "non [[" .. stem .. "ire]]"}
	data.forms.impr_3sg = {stem .. "a"}
	data.forms.impr_1pl = {stem .. "iamo"}
	data.forms.impr_2pl = {stem .. "ite"}
	data.forms.impr_3pl = {stem .. "ano"}
end

inflections["irsi"] = function(args, data)
	inflections["ire"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "irsi"}
	data.forms.gerund = {stem .. "endosi"}
	data.forms.pres_ptc = {stem .. "entesi"}
	table.insert(data.forms.past_ptc, stem .. "itosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "itene", "non te ne [[" .. stem .. "ire]]", "non [[" .. stem .. "irtene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "itela", "non te la [[" .. stem .. "ire]]", "non [[" .. stem .. "irtela]]"}
	else
		data.forms.impr_2sg = {stem .. "iti", "non ti [[" .. stem .. "ire]]", "non [[" .. stem .. "irti]]"}
	end	
	data.forms.impr_1pl = {stem .. "iamoci"}
	data.forms.impr_2pl = {stem .. "itevi"}
end

inflections["ire-b"] = function(args, data)
	local stem = data.stem
	data.title = "Tercera conjugació tema ''i'' velar, auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "ire"}
	data.forms.gerund = {stem .. "endo"}
	data.forms.pres_ptc = {stem .. "ente"}
	data.forms.past_ptc = {stem .. "ito"}
	
	data.forms.pres_indc_1sg = {stem .. "isco"}
	data.forms.pres_indc_2sg = {stem .. "isci"}
	data.forms.pres_indc_3sg = {stem .. "isce"}
	data.forms.pres_indc_1pl = {stem .. "iamo"}
	data.forms.pres_indc_2pl = {stem .. "ite"}
	data.forms.pres_indc_3pl = {stem .. "iscono"}
	
	data.forms.impf_indc_1sg = {stem .. "ivo"}
	data.forms.impf_indc_2sg = {stem .. "ivi"}
	data.forms.impf_indc_3sg = {stem .. "iva"}
	data.forms.impf_indc_1pl = {stem .. "ivamo"}
	data.forms.impf_indc_2pl = {stem .. "ivate"}
	data.forms.impf_indc_3pl = {stem .. "ivano"}
	
	data.forms.phis_indc_1sg = {stem .. "ii"}
	data.forms.phis_indc_2sg = {stem .. "isti"}
	data.forms.phis_indc_3sg = {stem .. "ì"}
	data.forms.phis_indc_1pl = {stem .. "immo"}
	data.forms.phis_indc_2pl = {stem .. "iste"}
	data.forms.phis_indc_3pl = {stem .. "irono"}
	
	data.forms.futr_indc_1sg = {stem .. "irò"}
	data.forms.futr_indc_2sg = {stem .. "irai"}
	data.forms.futr_indc_3sg = {stem .. "irà"}
	data.forms.futr_indc_1pl = {stem .. "iremo"}
	data.forms.futr_indc_2pl = {stem .. "irete"}
	data.forms.futr_indc_3pl = {stem .. "iranno"}
	
	data.forms.cond_1sg = {stem .. "irei"}
	data.forms.cond_2sg = {stem .. "iresti"}
	data.forms.cond_3sg = {stem .. "irebbe"}
	data.forms.cond_1pl = {stem .. "iremmo"}
	data.forms.cond_2pl = {stem .. "ireste"}
	data.forms.cond_3pl = {stem .. "irebbero"} 
	
	data.forms.pres_subj_123sg = {stem .. "isca"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "iamo"}
	data.forms.pres_subj_2pl = {stem .. "iate"}
	data.forms.pres_subj_3pl = {stem .. "iscano"}
	
	data.forms.impf_subj_12sg = {stem .. "issi"}
	data.forms.impf_subj_3sg = {stem .. "isse"}
	data.forms.impf_subj_1pl = {stem .. "issimo"}
	data.forms.impf_subj_2pl = {stem .. "iste"}
	data.forms.impf_subj_3pl = {stem .. "issero"}
	
	data.forms.impr_2sg = {stem .. "isci", "non [[" .. stem .. "ire]]"}
	data.forms.impr_3sg = {stem .. "isca"}
	data.forms.impr_1pl = {stem .. "iamo"}
	data.forms.impr_2pl = {stem .. "ite"}
	data.forms.impr_3pl = {stem .. "iscano"}
end

inflections["irsi-b"] = function(args, data)
	inflections["ire-b"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "irsi"}
	data.forms.gerund = {stem .. "endosi"}
	data.forms.pres_ptc = {stem .. "entesi"}
	table.insert(data.forms.past_ptc, stem .. "itosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "iscitene", "non te ne [[" .. stem .. "ire]]", "non [[" .. stem .. "irtene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "iscitela", "non te la [[" .. stem .. "ire]]", "non [[" .. stem .. "irtela]]"}
	else
		data.forms.impr_2sg = {stem .. "isciti", "non ti [[" .. stem .. "ire]]", "non [[" .. stem .. "irti]]"}
	end	
	data.forms.impr_1pl = {stem .. "iamoci"}
	data.forms.impr_2pl = {stem .. "itevi"}
end

inflections["urre"] = function(args, data)
	local stem = data.stem
	data.title = "Segona conjugació tema ''e'', auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "urre"}
	data.forms.gerund = {stem .. "ucendo"}
	data.forms.pres_ptc = {stem .. "ucente"}
	data.forms.past_ptc = {stem .. "otto"}
	
	data.forms.pres_indc_1sg = {stem .. "uco"}
	data.forms.pres_indc_2sg = {stem .. "uci"}
	data.forms.pres_indc_3sg = {stem .. "uce"}
	data.forms.pres_indc_1pl = {stem .. "uciamo"}
	data.forms.pres_indc_2pl = {stem .. "ucete"}
	data.forms.pres_indc_3pl = {stem .. "ucono"}
	
	data.forms.impf_indc_1sg = {stem .. "ucevo"}
	data.forms.impf_indc_2sg = {stem .. "ucevi"}
	data.forms.impf_indc_3sg = {stem .. "uceva"}
	data.forms.impf_indc_1pl = {stem .. "ucevamo"}
	data.forms.impf_indc_2pl = {stem .. "ucevate"}
	data.forms.impf_indc_3pl = {stem .. "ucevano"}
	
	data.forms.phis_indc_1sg = {stem .. "ussi"}
	data.forms.phis_indc_2sg = {stem .. "ucesti"}
	data.forms.phis_indc_3sg = {stem .. "usse"}
	data.forms.phis_indc_1pl = {stem .. "ucemmo"}
	data.forms.phis_indc_2pl = {stem .. "uceste"}
	data.forms.phis_indc_3pl = {stem .. "ussero"}
	
	data.forms.futr_indc_1sg = {stem .. "urrò"}
	data.forms.futr_indc_2sg = {stem .. "urrai"}
	data.forms.futr_indc_3sg = {stem .. "urrà"}
	data.forms.futr_indc_1pl = {stem .. "urremo"}
	data.forms.futr_indc_2pl = {stem .. "urrete"}
	data.forms.futr_indc_3pl = {stem .. "urranno"} 
	
	data.forms.cond_1sg = {stem .. "urrei"}
	data.forms.cond_2sg = {stem .. "urresti"}
	data.forms.cond_3sg = {stem .. "urrebbe"}
	data.forms.cond_1pl = {stem .. "urremmo"}
	data.forms.cond_2pl = {stem .. "urreste"}
	data.forms.cond_3pl = {stem .. "urrebbero"} 
	
	data.forms.pres_subj_123sg = {stem .. "uca"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "uciamo"}
	data.forms.pres_subj_2pl = {stem .. "uciate"}
	data.forms.pres_subj_3pl = {stem .. "ucano"}
	
	data.forms.impf_subj_12sg = {stem .. "ucessi"}
	data.forms.impf_subj_3sg = {stem .. "ucesse"}
	data.forms.impf_subj_1pl = {stem .. "ucessimo"}
	data.forms.impf_subj_2pl = {stem .. "uceste"}
	data.forms.impf_subj_3pl = {stem .. "ucessero"}
	
	data.forms.impr_2sg = {stem .. "uci", "non [[" .. stem .. "urre]]"}
	data.forms.impr_3sg = {stem .. "uca"}
	data.forms.impr_1pl = {stem .. "uciamo"}
	data.forms.impr_2pl = {stem .. "ucete"}
	data.forms.impr_3pl = {stem .. "ucano"}
end

inflections["ursi"] = function(args, data)
	inflections["urre"](args, data)
	
	local stem = data.stem
	data.refl = true
	
	data.forms.infinitive = {stem .. "ursi"}
	data.forms.gerund = {stem .. "ucendosi"}
	data.forms.pres_ptc = {stem .. "ucentesi"}
	table.insert(data.forms.past_ptc, stem .. "ottosi")
	if args["inf"] and mw.ustring.match(args["inf"], "ne$") then
		data.forms.impr_2sg = {stem .. "ucitene", "non te ne [[" .. stem .. "urre]]", "non [[" .. stem .. "urtene]]"}
	elseif args["inf"] and mw.ustring.match(args["inf"], "la$") then
		data.forms.impr_2sg = {stem .. "ucitela", "non te la [[" .. stem .. "urre]]", "non [[" .. stem .. "urtela]]"}
	else
		data.forms.impr_2sg = {stem .. "uciti", "non ti [[" .. stem .. "urre]]", "non [[" .. stem .. "urti]]"}
	end	
	data.forms.impr_1pl = {stem .. "uciamoci"}
	data.forms.impr_2pl = {stem .. "ucetevi"}
end

inflections["fare"] = function(args, data)
	local stem = data.stem
	data.title = "Tercera conjugació tema ''i'', infinitiu irregular, auxiliar ''" .. table.concat(data.forms.aux, " o ") .. "''"
	
	data.forms.infinitive = {stem .. "fare"}
	data.forms.gerund = {stem .. "facendo"}
	data.forms.pres_ptc = {stem .. "facente"}
	data.forms.past_ptc = {stem .. "fatto"}
	
	data.forms.pres_indc_1sg = {stem .. "faccio", stem .. "fò"}
	data.forms.pres_indc_2sg = {stem .. "fai"}
	data.forms.pres_indc_3sg = {stem .. "fà"}
	data.forms.pres_indc_1pl = {stem .. "facciamo"}
	data.forms.pres_indc_2pl = {stem .. "fate"}
	data.forms.pres_indc_3pl = {stem .. "fanno"}
	
	data.forms.impf_indc_1sg = {stem .. "facevo"}
	data.forms.impf_indc_2sg = {stem .. "facevi"}
	data.forms.impf_indc_3sg = {stem .. "faceva"}
	data.forms.impf_indc_1pl = {stem .. "facevamo"}
	data.forms.impf_indc_2pl = {stem .. "facevate"}
	data.forms.impf_indc_3pl = {stem .. "facevano"}
	
	data.forms.phis_indc_1sg = {stem .. "feci"}
	data.forms.phis_indc_2sg = {stem .. "facesti"}
	data.forms.phis_indc_3sg = {stem .. "fece"}
	data.forms.phis_indc_1pl = {stem .. "facemmo"}
	data.forms.phis_indc_2pl = {stem .. "faceste"}
	data.forms.phis_indc_3pl = {stem .. "fecero"}
	
	data.forms.futr_indc_1sg = {stem .. "farò"}
	data.forms.futr_indc_2sg = {stem .. "farai"}
	data.forms.futr_indc_3sg = {stem .. "farà"}
	data.forms.futr_indc_1pl = {stem .. "faremo"}
	data.forms.futr_indc_2pl = {stem .. "farete"}
	data.forms.futr_indc_3pl = {stem .. "faranno"}
	
	data.forms.cond_1sg = {stem .. "farei"}
	data.forms.cond_2sg = {stem .. "faresti"}
	data.forms.cond_3sg = {stem .. "farebbe"}
	data.forms.cond_1pl = {stem .. "faremmo"}
	data.forms.cond_2pl = {stem .. "fareste"}
	data.forms.cond_3pl = {stem .. "farebbero"} 
	
	data.forms.pres_subj_123sg = {stem .. "faccia"}
	data.forms.pres_subj_3sg = nil
	data.forms.pres_subj_1pl = {stem .. "facciamo"}
	data.forms.pres_subj_2pl = {stem .. "facciate"}
	data.forms.pres_subj_3pl = {stem .. "facciano"}
	
	data.forms.impf_subj_12sg = {stem .. "facessi"}
	data.forms.impf_subj_3sg = {stem .. "facesse"}
	data.forms.impf_subj_1pl = {stem .. "facessimo"}
	data.forms.impf_subj_2pl = {stem .. "faceste"}
	data.forms.impf_subj_3pl = {stem .. "facessero"}
	
	data.forms.impr_2sg = {stem .. "fà", stem .. "fai", stem .. "fa'", "non [[" .. stem .. "fare]]"}
	data.forms.impr_3sg = {stem .. "faccia"}
	data.forms.impr_1pl = {stem .. "facciamo"}
	data.forms.impr_2pl = {stem .. "fate"}
	data.forms.impr_3pl = {stem .. "facciano"}
end

-- Shows forms with links, or a dash if empty
local function show_form(subforms, param)
	if not subforms then
		return "| —"
	elseif type(subforms) ~= "table" then
		error("a non-table value was given in the list of inflected forms.")
	elseif #subforms == 0 then
		return "| —"
	end
	
	local ret = {}
	
	-- Go over each subform and insert links
	for key, subform in ipairs(subforms) do
		table.insert(ret, m_links.full_link({lang = lang, term = subform}))
	end
	
	-- Style irregular forms if provided as parameter
	local style_text = ''
	if param then
		style_text = 'style="background:#DCDCDC;" | '
	else
		style_text = 'style="background:transparent;" | '
	end
	
	return style_text .. table.concat(ret, ", ")
end

-- Shows the table with the given forms
function make_table(data, args)
	-- fixme: compostos de infinitiu passat i gerundi passat
	return [=[<div class="NavFrame">
<div class="NavHead">&nbsp; &nbsp; ]=] .. data.title .. [=[</div>
<div class="NavContent">
{| style="background:#F0F0F0;border-collapse:separate;border-spacing:2px;width:100%" class="inflection-table"
|-
! colspan="1" style="background:#C0C0C0" | Formes no personals
! colspan="3" style="background:#C0C0C0" | <span title="presente">present</span>
! colspan="3" style="background:#C0C0C0" | <span title="passato">passat</span>

|-
! colspan="1" style="background:#e2e4c0" | <span title="infinito">infinitiu</span>
| colspan="3" ]=] .. show_form(data.forms.infinitive, nil) .. [=[

| colspan="3" ]=] .. show_form(data.forms.past_inf, nil) .. [=[

|-
! colspan="1" style="background:#e2e4c0" | <span title="gerundio">gerundi</span>
| colspan="3" ]=] .. show_form(data.forms.gerund, args["ger"]) .. [=[

| colspan="3" ]=] .. show_form(data.forms.past_ger, nil) .. [=[

|-
! colspan="1" style="background:#e2e4c0" |  <span title="participio">participi</span>
| colspan="3" ]=] .. show_form(data.forms.pres_ptc, args["presp"]) .. [=[

| colspan="3" ]=] .. show_form(data.forms.past_ptc, args["pastp"]) .. [=[

|-
! colspan="1" rowspan="2" style="background:#C0C0C0" | Formes personals
! colspan="3" style="background:#C0C0C0" | <span title="singolare">singular</span>
! colspan="3" style="background:#C0C0C0" | <span title="plurale">plural</span>
|-
! style="background:#C0C0C0;width:12.5%" | <span title="prima">primera</span>
! style="background:#C0C0C0;width:12.5%" | <span title="seconda">segona</span>
! style="background:#C0C0C0;width:12.5%" | <span title="terza">tercera</span>
! style="background:#C0C0C0;width:12.5%" | <span title="prima">primera</span>
! style="background:#C0C0C0;width:12.5%" | <span title="seconda">segona</span>
! style="background:#C0C0C0;width:12.5%" | <span title="terza">tercera</span>
|-
! style="background:#c0cfe4" colspan="1" | <span title="indicativo">indicatiu</span>
! style="background:#c0cfe4" | io
! style="background:#c0cfe4" | tu
! style="background:#c0cfe4" | lui/lei, esso/essa
! style="background:#c0cfe4" | noi
! style="background:#c0cfe4" | voi
! style="background:#c0cfe4" | loro, essi/esse
|-
! style="height:3em;background:#c0cfe4" colspan="1" | <span title="presente">present</span>
| ]=] .. show_form(data.forms.pres_indc_1sg, args["pres1s"]) .. [=[

| ]=] .. show_form(data.forms.pres_indc_2sg, args["pres2s"]) .. [=[

| ]=] .. show_form(data.forms.pres_indc_3sg, args["pres3s"]) .. [=[

| ]=] .. show_form(data.forms.pres_indc_1pl, args["pres1p"]) .. [=[

| ]=] .. show_form(data.forms.pres_indc_2pl, args["pres2p"]) .. [=[

| ]=] .. show_form(data.forms.pres_indc_3pl, args["pres3p"]) .. [=[

|-
! style="height:3em;background:#c0cfe4" colspan="1" | <span title="imperfetto">imperfet</span>
| ]=] .. show_form(data.forms.impf_indc_1sg, args["imperf1s"]) .. [=[

| ]=] .. show_form(data.forms.impf_indc_2sg, args["imperf2s"]) .. [=[

| ]=] .. show_form(data.forms.impf_indc_3sg, args["imperf3s"]) .. [=[

| ]=] .. show_form(data.forms.impf_indc_1pl, args["imperf1p"]) .. [=[

| ]=] .. show_form(data.forms.impf_indc_2pl, args["imperf2p"]) .. [=[

| ]=] .. show_form(data.forms.impf_indc_3pl, args["imperf3p"]) .. [=[

|-
! style="height:3em;background:#c0cfe4" colspan="1" | <span title="passato remoto">passat</span>
| ]=] .. show_form(data.forms.phis_indc_1sg, args["prem1s"]) .. [=[

| ]=] .. show_form(data.forms.phis_indc_2sg, args["prem2s"]) .. [=[

| ]=] .. show_form(data.forms.phis_indc_3sg, args["prem3s"]) .. [=[

| ]=] .. show_form(data.forms.phis_indc_1pl, args["prem1p"]) .. [=[

| ]=] .. show_form(data.forms.phis_indc_2pl, args["prem2p"]) .. [=[

| ]=] .. show_form(data.forms.phis_indc_3pl, args["prem3p"]) .. [=[

|-
! style="height:3em;background:#c0cfe4" colspan="1" | <span title="futuro semplice">futur</span>
| ]=] .. show_form(data.forms.futr_indc_1sg, args["fut1s"]) .. [=[

| ]=] .. show_form(data.forms.futr_indc_2sg, args["fut2s"]) .. [=[

| ]=] .. show_form(data.forms.futr_indc_3sg, args["fut3s"]) .. [=[

| ]=] .. show_form(data.forms.futr_indc_1pl, args["fut1p"]) .. [=[

| ]=] .. show_form(data.forms.futr_indc_2pl, args["fut2p"]) .. [=[

| ]=] .. show_form(data.forms.futr_indc_3pl, args["fut3p"]) .. [=[

|-
! style="height:3em;background:#c0cfe4" colspan="1" | <span title="condizionale presente">condicional</span>
| ]=] .. show_form(data.forms.cond_1sg, args["cond1s"]) .. [=[

| ]=] .. show_form(data.forms.cond_2sg, args["cond2s"]) .. [=[

| ]=] .. show_form(data.forms.cond_3sg, args["cond3s"]) .. [=[

| ]=] .. show_form(data.forms.cond_1pl, args["cond1p"]) .. [=[

| ]=] .. show_form(data.forms.cond_2pl, args["cond2p"]) .. [=[

| ]=] .. show_form(data.forms.cond_3pl, args["cond3p"]) .. [=[

|-
! style="background:#c0e4c0" colspan="1" | <span title="congiuntivo">subjuntiu</span>
! style="background:#c0e4c0" | che io
! style="background:#c0e4c0" | che tu
! style="background:#c0e4c0" | che lui/che lei, che esso/che essa
! style="background:#c0e4c0" | che noi
! style="background:#c0e4c0" | che voi
! style="background:#c0e4c0" | che loro, che essi/che esse
|-
! style="height:3em;background:#c0e4c0" | <span title="congiuntivo presente">present</span>
| ]=] .. show_form(data.forms.pres_subj_1sg, args["sub123s"]) .. [=[

| ]=] .. show_form(data.forms.pres_subj_2sg, args["sub123s"]) .. [=[

| ]=] .. show_form(data.forms.pres_subj_3sg, args["sub123s"] or args["sub3s"]) .. [=[

| ]=] .. show_form(data.forms.pres_subj_1pl, args["sub1p"]) .. [=[

| ]=] .. show_form(data.forms.pres_subj_2pl, args["sub2p"]) .. [=[

| ]=] .. show_form(data.forms.pres_subj_3pl, args["sub3p"]) .. [=[

|-
! style="height:3em;background:#c0e4c0" rowspan="1" | <span title="congiuntivo imperfetto">imperfet</span>
| ]=] .. show_form(data.forms.impf_subj_1sg, args["impsub12s"]) .. [=[

| ]=] .. show_form(data.forms.impf_subj_2sg, args["impsub12s"]) .. [=[

| ]=] .. show_form(data.forms.impf_subj_3sg, args["impsub3s"]) .. [=[

| ]=] .. show_form(data.forms.impf_subj_1pl, args["impsub1p"]) .. [=[

| ]=] .. show_form(data.forms.impf_subj_2pl, args["impsub2p"]) .. [=[

| ]=] .. show_form(data.forms.impf_subj_3pl, args["impsub3p"]) .. [=[

|-
! colspan="1" rowspan="2" style="height:3em;background:#e4d4c0" | <span title="imperativo">imperatiu</span>
! style="background:#e4d4c0" | &mdash;
! style="background:#e4d4c0" | tu
! style="background:#e4d4c0" | lui/lei
! style="background:#e4d4c0" | noi
! style="background:#e4d4c0" | voi
! style="background:#e4d4c0" | loro
|-
|
| ]=] .. show_form(data.forms.impr_2sg, args["imp2s"]) .. [=[

| ]=] .. show_form(data.forms.impr_3sg, args["imp3s"]) .. [=[

| ]=] .. show_form(data.forms.impr_1pl, args["imp1p"]) .. [=[

| ]=] .. show_form(data.forms.impr_2pl, args["imp2p"]) .. [=[

| ]=] .. show_form(data.forms.impr_3pl, args["imp3p"]) .. [=[

|-
|}</div></div>]=]
end

return p