Mòdul:ca-verb/llegir
La documentació d'ús d'aquest mòdul es pot crear a Mòdul:ca-verb/llegir/ús
-- Formes pures dels verbs -llegir, -fegir, -fregir, -teixir, -tenyir.
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_i = forma.inf:reverse():gsub("i?e", "i", 1):reverse():gsub("ir$", "")
local radical_i_a = radical_i:gsub("g$", "j")
local fila = #forma["pres-ind"] + 1
if zona.bal or zona.val or zona.alg then
forma["pres-ind"][fila] = {}
forma["pres-ind"][fila][1] = radical_i
if zona.bal or zona.val then
forma["pres-ind"][fila][2] = radical_i .. (radical_i:find("iny$") and "" or "e") .. "s"
forma["pres-ind"][fila][3] = radical_i
forma["pres-ind"][fila][6] = radical_i .. "en"
forma["pres-ind"][fila]["nota"] = llista_zones({"bal", "val"}, zona)
fila = fila + 1
end
if zona.alg then
if forma["pres-ind"][fila] == nil then
forma["pres-ind"][fila] = {}
end
forma["pres-ind"][fila][2] = radical_i .. "is"
forma["pres-ind"][fila][3] = radical_i .. "i"
forma["pres-ind"][fila][6] = radical_i .. "in"
forma["pres-ind"][fila]["nota"] = "alg"
end
end
fila = #forma["pres-subj"] + 1
if zona.bal or zona.alg then
forma["pres-subj"][fila] = {}
forma["pres-subj"][fila][1] = radical_i .. "i"
forma["pres-subj"][fila][2] = radical_i .. "is"
forma["pres-subj"][fila][3] = radical_i .. "i"
forma["pres-subj"][fila][6] = radical_i .. "in"
forma["pres-subj"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)
fila = fila + 1
end
if zona.val then
forma["pres-subj"][fila] = {}
forma["pres-subj"][fila][1] = radical_i_a .. "a"
forma["pres-subj"][fila][2] = radical_i .. "es"
forma["pres-subj"][fila][3] = radical_i_a .. "a"
forma["pres-subj"][fila][6] = radical_i .. "en"
forma["pres-subj"][fila]["nota"] = "val"
end
fila = #forma["imp"] + 1
if zona.bal or zona.val then
forma["imp"][fila] = {}
forma["imp"][fila][2] = radical_i
forma["imp"][fila]["nota"] = llista_zones({"bal", "val"}, zona)
fila = fila + 1
end
if zona.bal or zona.alg then
forma["imp"][fila] = {}
forma["imp"][fila][3] = radical_i .. "i"
forma["imp"][fila][6] = radical_i .. "in"
forma["imp"][fila]["nota"] = llista_zones({"bal", "alg"}, zona)
fila = fila + 1
end
if zona.val then
forma["imp"][fila] = {}
forma["imp"][fila][3] = radical_i_a .. "a"
forma["imp"][fila][6] = radical_i .. "en"
forma["imp"][fila]["nota"] = "val"
end
if zona.nocc and forma["no-imperf-ind"] then
forma["no-imperf-ind"][2] = nil
end
forma["no-pass"] = nil
return forma
end
return export