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

-- Formes pures dels verbs ferir i derivats més penedir.
local export = {}

local 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 = forma.inf:gsub("ir$", "")
	local radical_diacr = radical == "fer" and "fér" or radical
	local radical0 = radical == "pened" and "penet" or radical_diacr

	local fila = #forma["pres-ind"] + 1
	if zona.bal or zona.alg then
		forma["pres-ind"][fila] = {}
		forma["pres-ind"][fila][1] = radical0
		forma["pres-ind"][fila][2] = radical0 .. "s"
		forma["pres-ind"][fila][3] = radical0
		forma["pres-ind"][fila][6] = radical_diacr .. "en"
		forma["pres-ind"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)

		fila = #forma["pres-subj"] + 1
		forma["pres-subj"][fila] = {}
		forma["pres-subj"][fila][1] = radical .. "i"
		forma["pres-subj"][fila][2] = radical .. "is"
		forma["pres-subj"][fila][3] = radical .. "i"
		forma["pres-subj"][fila][6] = radical .. "in"
		forma["pres-subj"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)

		fila = #forma["imp"] + 1
		forma["imp"][fila] = {}
		forma["imp"][fila][2] = radical0
		forma["imp"][fila][3] = radical .. "i"
		forma["imp"][fila][6] = radical .. "in"
		forma["imp"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)
	end

	return forma
end

return export