Ce module définit une fonction utilisée par le modèle {{ia-conj}} pour générer un tableau de conjugaison en interlingua.
conjugaison()
Génère le tableau de conjugaisons pour le verbe donné.
1
(string, optionnel) : Le verbe à l’infinitif s’il ne peut pas être déduit du titre de la page.pr
(string, optionnel) : Forme du présent si elle diffère de celle par défaut.prp
(string, optionnel) : Forme du présent pluriel si elle existe.ppr
(string, optionnel) : Participe présent s’il diffère de celle par défaut.ps
(string, optionnel) : Forme alternative du passé si elle existe.La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis la page Module:conjugaisons-interlingua/Documentation. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (créer) et créer des tests unitaires (créer).
Voir les appels depuis d'autres modules.
local m_bases = require("Module:bases")
local m_params = require("Module:paramètres")
local p = {}
local function link(word)
return m_bases.lien_modele(word, "ia")
end
--- Generate the conjugation table for the given verb.
--- @param infinitive string The infinitive form of the verb.
--- @param presentForm string|nil The present form if it is different from the the default one.
--- @param presentPluralForm string|nil The present plural form, if it exists.
--- @param presentParticiple string|nil The present participle if it is different from the the default one.
--- @param pastForm string|nil The alternative past form, if it exists.
--- @return string The generate table.
local function generateTable(infinitive, presentForm, presentPluralForm, presentParticiple, pastForm)
local root = mw.ustring.sub(infinitive, 1, -3)
local root2 = mw.ustring.sub(infinitive, 1, -2)
local vowel = mw.ustring.sub(infinitive, -2, -2)
presentParticiple = presentParticiple or (root .. ({ a = "a", e = "e", i = "ie" }) .. "nte")
local pastParticiple = root .. ({ a = "a", e = "i", i = "i" }) .. "te"
return mw.ustring.format([=[
{|class="wikitable" style="width: 100%%"
|+ Voix active
! Infinitif !! Participe présent !! Participe passé !! — !! —
|-
| %s || %s || %s || — || —
|-
! colspan="5" | Temps simples
|-
! Présent !! Passé !! Futur !! Conditionnel !! Impératif
|-
| %s
| %s
| %s<br><small>ou</small> va %s
| %s<br><small>ou</small> velle %s
| %s
|-
! colspan="5" | Temps composés
|-
! Passé composé !! Plus-que-parfait !! Futur antérieur !! Conditionnel passé !! —
|-
| ha %s
| habeva %s
| habera %s<br><small>ou</small> va haber %s
| haberea %s<br><small>ou</small> velle haber %s
| —
|}
{|class="wikitable" style="width: 100%%"
|+ Voix passive
! Infinitif !! Participe présent !! Participe passé !! —
|-
| esser %s || essente %s || essite %s || —
|-
! colspan="4" | Temps simples
|-
! Présent !! Passé !! Futur !! Conditionnel
|-
| es %s
| esseva %s
| essera %s<br><small>ou</small> va esser %s
| esserea %s<br><small>ou</small> velle esser %s
|-
! colspan="4" | Temps composés
|-
! Passé composé !! Plus-que-parfait !! Futur antérieur !! Conditionnel passé
|-
| ha essite %s
| habeva essite %s
| habera essite %s<br><small>ou</small> va haber essite %s
| haberea essite %s<br><small>ou</small> velle haber essite %s
|}
]=],
-- Active base forms
link(infinitive),
link(presentParticiple),
link(pastParticiple),
-- Active simple tenses
link(presentForm or root2)
.. (presentPluralForm and ("<br>'''Note :''' Au pluriel, on peut employer " .. link(presentPluralForm)) or ""),
link(root2 .. "va") .. (pastForm and ("<br><small>ou</small> " .. link(pastForm)) or ""),
link(root2 .. "ra"), link(infinitive),
link(root2 .. "rea"), link(infinitive),
link(root2),
-- Active compound tenses
link(pastParticiple),
link(pastParticiple),
link(pastParticiple), link(pastParticiple),
link(pastParticiple), link(pastParticiple),
-- Passive base forms
link(pastParticiple),
link(pastParticiple),
link(pastParticiple),
-- Passive simple tenses
link(pastParticiple),
link(pastParticiple),
link(pastParticiple), link(pastParticiple),
link(pastParticiple), link(pastParticiple),
-- Passive compound tenses
link(pastParticiple),
link(pastParticiple),
link(pastParticiple), link(pastParticiple),
link(pastParticiple), link(pastParticiple)
) .. m_bases.fait_categorie_contenu("Conjugaison en interlingua", infinitive)
end
--- Generate the conjugation table for an Interlingua verb.
--- Parameters:
--- parent frame.args (string, optional): Infinitive form, if empty the page’s title will be used.
--- parent frame.args (string, optional): Present form, if different from default one.
--- parent frame.args (string, optional): Present plural form, if it exists.
--- parent frame.args (string, optional): Present participle, if different from default one.
--- parent frame.args (string, optional): Alternative past tense form, if it exists.
--- @return string The generated table.
function p.conjugaison(frame)
local args = m_params.process(frame:getParent().args, {
= {},
= {},
= {},
= {},
= {},
})
local title = mw.title.getCurrentTitle()
local verb
if not args and title.namespace == m_bases.NS_CONJUGAISON.id then
-- Keep text after first "/"
verb = mw.ustring.sub(title.text, mw.ustring.find(title.text, "/", 1, true) + 1)
else
verb = args or title.text
end
if not mw.ustring.find(verb, "r$") then
return "<span style='color: red'>Erreur : Le mot ne se termine pas par -ar, -er ou -ir.</span>"
.. m_bases.fait_categorie_contenu("Appels de modèles incorrects:ia-conj")
end
return generateTable(
verb,
args,
args,
args,
args
)
end
return p