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

-- Formes irregulars dels verbs -éixer, -èixer i -nà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 .. "scut"
	forma.part[1]["f-s"] = radical .. "scuda"
	forma.part[1]["m-p"] = radical .. "scuts"
	forma.part[1]["f-p"] = radical .. "scudes"
	
	forma["pres-ind"][1][2] = radical .. "ixes"
	
	local fila = 2
	if zona.val or zona.bal then
		forma["pres-ind"][fila] = {}
		forma["pres-ind"][fila][1] = radical .. "sc"
		forma["pres-ind"][fila]["nota"] = llista_zones({"val", "bal"}, zona)
		fila = fila + 1
	end
	if zona.bal or zona.alg then
		forma["pres-ind"][fila] = {}
		forma["pres-ind"][fila][1] = radical .. "ix"
		forma["pres-ind"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)
		fila = fila + 1
	end
	if zona.sept then
		forma["pres-ind"][fila] = {}
		forma["pres-ind"][fila][1] = radical .. "ixi"
		forma["pres-ind"][fila]["nota"] = "sept"
	end
	
	forma.pass[2] = {}
	forma.pass[2][1] = radical .. "squí"
	forma.pass[2][2] = radical .. "squeres"
	forma.pass[2][3] = radical .. "squé"
	forma.pass[2][4] = radical .. "squérem"
	forma.pass[2][5] = radical .. "squéreu"
	forma.pass[2][6] = radical .. "squeren"
	
	forma["pres-subj"][2] = {}
	forma["pres-subj"][2][4] = radical .. "squem"
	forma["pres-subj"][2][5] = radical .. "squeu"
	
	fila = 3
	if zona.occ then
		forma["pres-subj"][fila] = {}
		forma["pres-subj"][fila][1] = radical .. "sca"
		forma["pres-subj"][fila][2] = radical .. "sques"
		forma["pres-subj"][fila][3] = radical .. "sca"
		forma["pres-subj"][fila][6] = radical .. "squen"
		forma["pres-subj"][fila]["nota"] = "occ"
		fila = fila + 1
	end
	if zona.bal then
		forma["pres-subj"][fila] = {}
		forma["pres-subj"][fila][1] = radical .. "squi"
		forma["pres-subj"][fila][2] = radical .. "squis"
		forma["pres-subj"][fila][3] = radical .. "squi"
		forma["pres-subj"][fila][6] = radical .. "squin"
		forma["pres-subj"][fila]["nota"] = "bal"
		fila = fila + 1
	end
	
	forma["imperf-subj"][2][1] = radical .. "squés"
	forma["imperf-subj"][2][2] = radical .. "squessis"
	forma["imperf-subj"][2][3] = radical .. "squés"
	forma["imperf-subj"][2][4] = radical .. "squéssim"
	forma["imperf-subj"][2][5] = radical .. "squéssiu"
	forma["imperf-subj"][2][6] = radical .. "squessin"
	
	forma["imperf-subj"][3] = {}
	forma["imperf-subj"][3][2] = radical .. "squesses"
	forma["imperf-subj"][3][4] = radical .. "squéssem"
	forma["imperf-subj"][3][5] = radical .. "squésseu"
	forma["imperf-subj"][3][6] = radical .. "squessen"
	
	if zona.val then
		forma["imperf-subj"][4] = {}
		forma["imperf-subj"][4][1] = radical .. "squera"
		forma["imperf-subj"][4][2] = radical .. "squeres"
		forma["imperf-subj"][4][3] = radical .. "squera"
		forma["imperf-subj"][4][4] = radical .. "squérem"
		forma["imperf-subj"][4][5] = radical .. "squéreu"
		forma["imperf-subj"][4][6] = radical .. "squeren"
		forma["imperf-subj"][4]["nota"] = "val"
	end
	
	fila = 2
	if zona.occ then
		forma.imp[fila] = {}
		forma.imp[fila][3] = radical .. "sca"
		forma.imp[fila][4] = radical .. "squem"
		forma.imp[fila][6] = radical .. "squen"
		forma.imp[fila]["nota"] = "occ"
		fila = fila + 1
	end
	if zona.bal then
		forma.imp[fila] = {}
		forma.imp[fila][3] = radical .. "squi"
		forma.imp[fila][6] = radical .. "squin"
		forma.imp[fila]["nota"] = "bal"
	end
	
	if (zona.centr or zona.sept or zona.alg) and zona.alt then
		forma["no-part"] = {}
		forma["no-part"]["m-s"] = radical .. "ixut"
		forma["no-part"]["f-s"] = radical .. "ixuda"
		forma["no-part"]["m-p"] = radical .. "ixuts"
		forma["no-part"]["f-p"] = radical .. "ixudes"
		forma["no-part"]["nota"] = llista_zones({"centr", "sept", "alg"}, zona)
	end
		
	forma["no-pres-ind"] = nil
	
	forma["no-pres-subj"] = nil
	
	if zona.alt then
		forma["no-imperf-subj"][3] = nil
	end
	
	return forma
end

return export