Questo modulo costituisce il codice di funzionamento del Template:La-decl-part e crea, in base ai parametri inseriti in quest'ultimo, la tabella di declinazione dei participi verbali latini (funziona per il participio presente, perfetto, futuro e per il gerundio).
Recupera automaticamente la radice del participio in base al primo parametro passato dal template, e in base al parametro "tempo", sempre passato dal template, genera le forme flesse
-- MODULO PER LE TABELLE DI CONIUGAZIONE DEI *PARTICIPI* LATINI
-- DERIVATO DAL Modulo:La-decl-agg DI CUI DIVIDE BUONA PARTE DELLA STRUTTURA
local p = {}
function noaccenti(x) -- funzione che rimuove gli eventuali accenti lunghi e brevi dalla radice (stem); in pratica se si scrive 'puĕr' restituisce 'puer'
local dp={
='a',='a',
='e',='e',
='i',='i',
='o',='o',
='u',='u',
};
return (mw.ustring.gsub(x, '.', dp))
end
function p.lapart(frame)
tempo = frame.args --traduce il parametro "tempo", passato dal template
participio = frame.args
radice = mw.ustring.sub(participio, 1, -3)
aggettivo = frame.args or " "
--a partire dalla radice, e in base al tempo, genera le varie forme flesse
if tempo == "pres" then --participio presente, -ns -ntis
nom_s_m = p.wiki(radice.. "ns"); nom_s_n = p.wiki(radice.. "ns");
gen_s_m = p.wiki(radice.. "ntis"); gen_s_n = p.wiki(radice.. "ntis");
dat_s_m = p.wiki(radice.. "ntī"); dat_s_n = p.wiki(radice.. "ntī");
acc_s_m = p.wiki(radice.. "ntem"); acc_s_n = p.wiki(radice.. "ns");
voc_s_m = p.wiki(radice.. "ns"); voc_s_n = p.wiki(radice.. "ns");
abl_s_m = p.wiki(radice.. "nte").. ",<br/>".. p.wiki(radice.. "ntī").."<sup><small>1</small></sup>"; abl_s_n = p.wiki(radice.. "nte").. ",<br/>".. p.wiki(radice.. "ntī").."<sup><small>1</small></sup>"
--PLURALI
nom_p_m = p.wiki(radice.. "ntes"); nom_p_n = p.wiki(radice.. "ntĭa");
gen_p_m = p.wiki(radice.. "ntĭum"); gen_p_n = p.wiki(radice.. "ntĭum");
dat_p_m = p.wiki(radice.. "ntĭbus"); dat_p_n = p.wiki(radice.. "ntĭbus");
acc_p_m = p.wiki(radice.. "ntes"); acc_p_n = p.wiki(radice.. "ntĭa");
voc_p_m = p.wiki(radice.. "ntes"); voc_p_n = p.wiki(radice.. "ntĭa");
abl_p_m = p.wiki(radice.. "ntĭbus"); abl_p_n = p.wiki(radice.. "ntĭbus")
else --per tutti gli altri, declinazione a tre uscite -us -a -um
--SINGOLARI
nom_s_m = p.wiki(radice.. "us"); nom_s_f = p.wiki(radice.. "ă"); nom_s_n = p.wiki(radice.. "um");
gen_s_m = p.wiki(radice.. "ī"); gen_s_f = p.wiki(radice.. "ae"); gen_s_n = p.wiki(radice.. "ī");
dat_s_m = p.wiki(radice.. "ō"); dat_s_f = p.wiki(radice.. "ae"); dat_s_n = p.wiki(radice.. "ō");
acc_s_m = p.wiki(radice.. "ŭm"); acc_s_f = p.wiki(radice.. "ăm"); acc_s_n = p.wiki(radice.. "um");
voc_s_m = p.wiki(radice.. "ĕ"); voc_s_f = p.wiki(radice.. "ă"); voc_s_n = p.wiki(radice.. "um");
abl_s_m = p.wiki(radice.. "ō"); abl_s_f = p.wiki(radice.. "ā"); abl_s_n = p.wiki(radice.. "ō");
--PLURALI
nom_p_m = p.wiki(radice.. "ī"); nom_p_f = p.wiki(radice.. "ae"); nom_p_n = p.wiki(radice.. "ă");
gen_p_m = p.wiki(radice.. "ōrum"); gen_p_f = p.wiki(radice.. "ārum"); gen_p_n = p.wiki(radice.. "ōrum");
dat_p_m = p.wiki(radice.. "īs"); dat_p_f = p.wiki(radice.. "īs"); dat_p_n = p.wiki(radice.. "īs");
acc_p_m = p.wiki(radice.. "ōs"); acc_p_f = p.wiki(radice.. "ās"); acc_p_n = p.wiki(radice.. "ă");
voc_p_m = p.wiki(radice.. "ī"); voc_p_f = p.wiki(radice.. "ae"); voc_p_n = p.wiki(radice.. "ă");
abl_p_m = p.wiki(radice.. "īs"); abl_p_f = p.wiki(radice.. "īs"); abl_p_n = p.wiki(radice.. "īs");
end
--stringa "descrizione", genera una breve descrizione in cima alla tabella
if tempo == "pres" then
descrizione = "participio presente<br><small>aggettivo di II classe</small>"
elseif tempo == "perf" then
descrizione = "participio perfetto<br><small>aggettivo di I classe</small>"
elseif tempo == "fut" then
descrizione = "participio futuro<br><small>aggettivo di I classe</small>"
elseif tempo == "ger" then
descrizione = "gerundivo<br><small>aggettivo di I classe</small>"
end
--stringa "categoria", aggiunge le relative categorie al lemma
categoriaaggettivo = ""
if tempo == "pres" then
categoria = "]"
elseif tempo == "perf" then
categoria = "]"
elseif tempo == "fut" then
categoria = "]"
elseif tempo == "ger" then
categoria = "]"
end
if aggettivo == "si" then
if tempo == "pres" then categoriaaggettivo = "]"
elseif tempo == "perf" or tempo == "fut" or tempo == "ger" then categoriaaggettivo = "]"
end
end
--costruisce le tabelle di coniugazione; attenzione che sono due tabelle distinte per i participi presenti a due uscite e per tutti gli altri a tre
if tempo == "pres" then --TABELLA A DUE COLONNE
decl = ].."\n"
decl = decl.. "|+".. descrizione.. categoria .. categoriaaggettivo .. "\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. nom_s_m.. '\n'.. ].. nom_s_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. gen_s_m.. '\n'.. ].. gen_s_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. dat_s_m.. '\n'.. ].. dat_s_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. acc_s_m.. '\n'.. ].. acc_s_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. voc_s_m.. '\n'.. ].. voc_s_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. abl_s_m.. '\n'.. ].. abl_s_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. nom_p_m.. '\n'.. ].. nom_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. gen_p_m.. '\n'.. ].. gen_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. dat_p_m.. '\n'.. ].. dat_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. acc_p_m.. '\n'.. ].. acc_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. voc_p_m.. '\n'.. ].. voc_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. abl_p_m.. '\n'.. ].. abl_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. "|-".."\n"
decl = decl.. "|}"
else --TABELLA A TRE COLONNE
decl = ].."\n"
decl = decl.. "|+".. descrizione .. categoria .. categoriaaggettivo .. "\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. nom_s_m.. '\n'.. ].. nom_s_f.. '\n'.. ].. nom_s_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. ].."\n"
decl = decl.. ].. gen_s_m.. '\n'.. ].. gen_s_f.. '\n'.. ].. gen_s_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. dat_s_m.. '\n'.. ].. dat_s_f.. '\n'.. ].. dat_s_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. acc_s_m.. '\n'.. ].. acc_s_f.. '\n'.. ].. acc_s_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. voc_s_m.. '\n'.. ].. voc_s_f.. '\n'.. ].. voc_s_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. abl_s_m.. '\n'.. ].. abl_s_f.. '\n'.. ].. abl_s_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. nom_p_m.. '\n'.. ].. nom_p_f.. '\n'.. ].. nom_p_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. gen_p_m.. '\n'.. ].. gen_p_f.. '\n'.. ].. gen_p_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. dat_p_m.. '\n'.. ].. dat_p_f.. '\n'.. ].. dat_p_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. acc_p_m.. '\n'.. ].. acc_p_f.. '\n'.. ].. acc_p_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. voc_p_m.. '\n'.. ].. voc_p_f.. '\n'.. ].. voc_p_n.. '\n'
decl = decl.. ].."\n"
decl = decl.. ].."\n"
decl = decl.. ].. abl_p_m.. '\n'.. ].. abl_p_f.. '\n'.. ].. abl_p_n.. '\n'
decl = decl.. "|-".."\n"
decl = decl.. "|}"
end
return decl
end
function p.wiki(x)
-- Utilizzato all'interno della funzione ladecl
if x == nil then return " " end
if x == "" then return " " end
-- aggiunge la categoria link rossi
if x >= "0" then
local y = noaccenti(x)
if mw.title.new(y).exists == false then
RedCat = "]"
else
RedCat = ""
end
-- Rende il suo argomento un wikilink, restituendo ad es. "], o lo rende nullo se non definito (per facilitare la concatenazione)
if y == mw.title.getCurrentTitle().text then return "'''".. x.. "'''"
else return "]".. RedCat end
else
return " "
end
end
return p