La documentació d'ús d'aquest mòdul es pot crear a Mòdul:ca-verb/aparèixer/ús

-- Formes irregulars dels verbs -parèixer o -paréixer.
local export = {}

function llista_zones(llista, zona)
	local zones = {}
	for k, v in pairs(llista) do
		if zona[v == "or" and "ori" or v == "n-occ" and "nocc" or v] then
			table.insert(zones, v)
		end
	end
	return #zones > 3 and "" or table.concat(zones, ", ")
end

function export.make_irregulars(forma, zona)
	local radical = mw.ustring.gsub(forma.inf, "[éè]ixer$", "e")

	forma.part[1]["m-s"] = radical .. "gut"
	forma.part[1]["f-s"] = radical .. "guda"
	forma.part[1]["m-p"] = radical .. "guts"
	forma.part[1]["f-p"] = radical .. "gudes"
	
	forma["pres-ind"][1][1] = radical .. "c"
	forma["pres-ind"][1][2] = radical .. "ixes"
	forma["pres-ind"][2] = nil
	forma["pres-ind"][3] = nil
	
	forma.pass[1][1] = radical .. "guí"
	forma.pass[1][2] = radical .. "gueres"
	forma.pass[1][3] = radical .. "gué"
	forma.pass[1][4] = radical .. "guérem"
	forma.pass[1][5] = radical .. "guéreu"
	forma.pass[1][6] = radical .. "gueren"
	
	forma["pres-subj"][1][1] = radical .. "gui"
	forma["pres-subj"][1][2] = radical .. "guis"
	forma["pres-subj"][1][3] = radical .. "gui"
	forma["pres-subj"][1][4] = radical .. "guem"
	forma["pres-subj"][1][5] = radical .. "gueu"
	forma["pres-subj"][1][6] = radical .. "guin"
	
	if zona.occ then
		forma["pres-subj"][2][1] = radical .. "ga"
		forma["pres-subj"][2][2] = radical .. "gues"
		forma["pres-subj"][2][3] = radical .. "ga"
		forma["pres-subj"][2][6] = radical .. "guen"
		forma["pres-subj"][2]["nota"] = "occ"
	end
	
	forma["imperf-subj"][1][1] = radical .. "gués"
	forma["imperf-subj"][1][2] = radical .. "guessis"
	forma["imperf-subj"][1][3] = radical .. "gués"
	forma["imperf-subj"][1][4] = radical .. "guéssim"
	forma["imperf-subj"][1][5] = radical .. "guéssiu"
	forma["imperf-subj"][1][6] = radical .. "guessin"
	
	forma["imperf-subj"][2][2] = radical .. "guesses"
	forma["imperf-subj"][2][4] = radical .. "guéssem"
	forma["imperf-subj"][2][5] = radical .. "guésseu"
	forma["imperf-subj"][2][6] = radical .. "guessen"
	
	if zona.val then
		forma["imperf-subj"][3][1] = radical .. "guera"
		forma["imperf-subj"][3][2] = radical .. "gueres"
		forma["imperf-subj"][3][3] = radical .. "guera"
		forma["imperf-subj"][3][4] = radical .. "guérem"
		forma["imperf-subj"][3][5] = radical .. "guéreu"
		forma["imperf-subj"][3][6] = radical .. "gueren"
	end
	
	forma.imp[1][3] = radical .. "gui"
	forma.imp[1][4] = radical .. "guem"
	forma.imp[1][6] = radical .. "guin"
	if zona.occ then
		forma.imp[2][3] = radical .. "ga"
		forma.imp[2][6] = radical .. "guen"
		forma.imp[2]["nota"] = "occ"
	end

	if zona.centr or zona.nocc or zona.bal then
		forma["no-ger"] = radical .. "guent"
	end
	
	if zona.centr or zona.nocc or zona.bal then
		forma["no-part"] = {}
		forma["no-part"]["m-s"] = radical .. "scut"
		forma["no-part"]["f-s"] = radical .. "scuda"
		forma["no-part"]["m-p"] = radical .. "scuts"
		forma["no-part"]["f-p"] = radical .. "scudes"
		forma["no-part"]["nota"] = llista_zones({"centr", "n-occ", "bal"}, zona)
	end
	
	local fila = 1
	if zona.centr or zona.nocc then
		forma["no-pres-ind"][fila] = {}
		forma["no-pres-ind"][fila][1] = radical .. "ixo"
		forma["no-pres-ind"][fila]["nota"] = llista_zones({"centr", "n-occ"}, zona)
		fila = fila + 1
	end
	if zona.alg or zona.bal then
		forma["no-pres-ind"][fila] = {}
		forma["no-pres-ind"][fila][1] = radical .. "ix"
		forma["no-pres-ind"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)
		fila = fila + 1
	end
	if zona.bal then
		forma["no-pres-ind"][fila] = {}
		forma["no-pres-ind"][fila][1] = radical .. "sc"
		forma["no-pres-ind"][fila]["nota"] = "bal"
		fila = fila + 1
	end
	
	if zona.bal then
		forma["no-pass"] = {}
		forma["no-pass"][1] = {}
		forma["no-pass"][1][1] = radical .. "squé"
		forma["no-pass"][1][2] = radical .. "squeres"
		forma["no-pass"][1][3] = radical .. "squé"
		forma["no-pass"][1][4] = radical .. "squérem"
		forma["no-pass"][1][5] = radical .. "squéreu"
		forma["no-pass"][1][6] = radical .. "squeren"
		forma["no-pass"][1]["nota"] = "bal"
	end
	
	if zona.alg then
		forma["no-cond"] = {}
		forma["no-cond"][1] = {}
		forma["no-cond"][1][1] = radical .. "ixeriva"
		forma["no-cond"][1][2] = radical .. "ixerives"
		forma["no-cond"][1][3] = radical .. "ixeriva"
		forma["no-cond"][1][4] = radical .. "ixerívem"
		forma["no-cond"][1][5] = radical .. "ixeríveu"
		forma["no-cond"][1][6] = radical .. "ixeriven"
		forma["no-cond"][1]["nota"] = "alg"
	end
	
	forma["no-pres-subj"] = {}
	fila = 1
	if zona.sept or zona.centr or zona.alg then
		forma["no-pres-subj"] = {}
		forma["no-pres-subj"][1] = {}
		forma["no-pres-subj"][1][1] = radical .. "ixi"
		forma["no-pres-subj"][1][2] = radical .. "ixis"
		forma["no-pres-subj"][1][3] = radical .. "ixi"
		forma["no-pres-subj"][1][4] = radical .. "ixem"
		forma["no-pres-subj"][1][5] = radical .. "ixeu"
		forma["no-pres-subj"][1][6] = radical .. "ixin"
		forma["no-pres-subj"][1]["nota"] = llista_zones({"centr", "sept", "alg"}, zona)
		fila = fila + 1
	end

	if zona.bal or zona.nocc then
		forma["no-pres-subj"][fila] = {}
		forma["no-pres-subj"][fila][1] = radical .. "sca"
		forma["no-pres-subj"][fila][2] = radical .. "sques"
		forma["no-pres-subj"][fila][3] = radical .. "sca"
		forma["no-pres-subj"][fila][4] = radical .. "squem"
		forma["no-pres-subj"][fila][5] = radical .. "squeu"
		forma["no-pres-subj"][fila][6] = radical .. "squen"
		forma["no-pres-subj"][fila]["nota"] = llista_zones({"bal", "n-occ"}, zona)
		fila = fila + 1
	end
	
	if zona.val then
		forma["no-pres-subj"][fila] = {}
		forma["no-pres-subj"][fila][4] = radical .. "gam"
		forma["no-pres-subj"][fila][5] = radical .. "gau"
		forma["no-pres-subj"][fila]["nota"] = "val"
	end
	
	forma["no-imperf-subj"] = {}
	fila = 1
	if zona.centr or zona.alg then
		forma["no-imperf-subj"][fila] = {}
		forma["no-imperf-subj"][fila][1] = radical .. "ixés"
		forma["no-imperf-subj"][fila][2] = radical .. "ixessis"
		forma["no-imperf-subj"][fila][3] = radical .. "ixés"
		forma["no-imperf-subj"][fila][4] = radical .. "ixéssim"
		forma["no-imperf-subj"][fila][5] = radical .. "ixéssiu"
		forma["no-imperf-subj"][fila][6] = radical .. "ixessin"
		forma["no-imperf-subj"][fila]["nota"] = llista_zones({"centr", "alg"}, zona)
		fila = fila + 1
	end
	if zona.alg then
		forma["no-imperf-subj"][fila] = {}
		forma["no-imperf-subj"][fila][1] = radical .. "ixessi"
		forma["no-imperf-subj"][fila]["nota"] = "alg"
		fila = fila + 1
	end
	if zona.nocc then
		forma["no-imperf-subj"][fila] = {}
		forma["no-imperf-subj"][fila][1] = radical .. "ixessa"
		forma["no-imperf-subj"][fila][2] = radical .. "ixesses"
		forma["no-imperf-subj"][fila][4] = radical .. "ixéssem"
		forma["no-imperf-subj"][fila][5] = radical .. "ixésseu"
		forma["no-imperf-subj"][fila][6] = radical .. "ixessen"
		forma["no-imperf-subj"][fila]["nota"] = "n-occ"
	end
	
	return forma
end

return export