Module:br-nom

Bonjour, vous êtes venu ici pour chercher la signification du mot Module:br-nom. Dans DICTIOUS, vous trouverez non seulement toutes les significations du dictionnaire pour le mot Module:br-nom, mais vous apprendrez également son étymologie, ses caractéristiques et comment dire Module:br-nom au singulier et au pluriel. Tout ce que vous devez savoir sur le mot Module:br-nom est ici. La définition du mot Module:br-nom vous aidera à être plus précis et correct lorsque vous parlerez ou écrirez vos textes. Connaître la définition deModule:br-nom, ainsi que celles d'autres mots, enrichit votre vocabulaire et vous fournit des ressources linguistiques plus nombreuses et de meilleure qualité.

 Documentation

Ce module permet de générer un tableau donnant les différentes formes, incluant les mutations éventuelles, pour les noms bretons.

Il utilise la fonction frame:getParent, il ne peut donc être appelé que par un modèle.

Modèles qui appellent ce module

Modèle Fonction activée Utilisation
{{br-nom}} boite_sp pour les noms ayant un singulier et/ou un, deux ou trois pluriels
{{br-nom-cs}} boite_cs pour les noms ayant un collectif et un singulatif
{{br-nom-csp}} boite_csp pour les noms ayant un collectif, un singulatif et un pluriel du singulatif
{{br-nom-duel}} boite_duel pour les noms ayant un duel
{{br-nom-pr}} boite_pr pour les noms propres

Voir ces modèles pour les paramètres et les exemples d’utilisation.

Modules utilisés


local p={}

local formes = require("Module:br-formes-mutees")

function ecritureLigne2Colonnes(txt,titre,m1,mot1)
	if m1 ~= mot1 then
		txt = txt ..
			'|-\n'..
			'! ' .. titre .. '\n'..
			'| ]\n'
	end
	return txt
end

function ecritureLigne3Colonnes(txt,titre,m1,mot1,m2,mot2)
	if m1 ~= mot1 or m2 ~= mot2 then
		txt = txt ..
			'|-\n'..
			'! ' .. titre .. '\n'
		if m1 == mot1 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
		if m2 == mot2 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
	end
	return txt
end

function ecritureLigne4Colonnes(txt,titre,m1,mot1,m2,mot2,m3,mot3)
	if m1 ~= mot1 or m2 ~= mot2 or m3 ~= mot3 then
		txt = txt .. 
			'|-\n'..
			'! ' .. titre .. '\n'
		if m1 == mot1 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
		if m2 == mot2 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
		if m3 == mot3 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
	end
	return txt
end

function ecritureLigne5Colonnes(txt,titre,m1,mot1,m2,mot2,m3,mot3,m4,mot4)
	if m1 ~= mot1 or m2 ~= mot2 or m3 ~= mot3 or m4 ~= mot4 then
		txt = txt .. 
			'|-\n'..
			'! ' .. titre .. '\n'
		if m1 == mot1 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
		if m2 == mot2 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
		if m3 == mot3 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
		if m4 == mot4 then
			txt = txt .. "| ''inchangé''\n"
		else
			txt = txt .. '| ]\n'
		end
	end
	return txt
end

function p.boite_sp(frame) -- pour les noms ayant une forme singulière, et/ou une, deux ou trois formes plurielles
	local args = frame:getParent().args
	local singulier, pluriel, pluriel2, pluriel3 = nil, nil, nil, nil
	singulier = args
	pluriel   = args
	pluriel2  = args
	pluriel3  = args
	local forme = args
	forme = forme or "Forme"
	txt = ""
	local as, ap, ap2, ap3, ss, sp, sp2, sp3, ds, dp, dp2, dp3, ns, np, np2, np3 = 
		nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil -- formes mutées : adoucissante ; spirante ; durcissante ; nasale
		
	as, ss, ds = formes.formesMutees(singulier)
	if pluriel3 then
		ap3, sp3, dp3 = formes.formesMutees(pluriel3)
		ap2, sp2, dp2 = formes.formesMutees(pluriel2)
		ap,  sp,  dp  = formes.formesMutees(pluriel)
		txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		'! Singulier\n'..
		'! Pluriel 1\n'..
		'! Pluriel 2\n'..
		'! Pluriel 3\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'..
		'| ]\n'..
		'| ]\n'..
		'| ]\n'
		txt = ecritureLigne5Colonnes(txt,'Adoucissante',as,singulier,ap,pluriel,ap2,pluriel2,ap3,pluriel3)
		txt = ecritureLigne5Colonnes(txt,'Spirante',ss,singulier,sp,pluriel,sp2,pluriel2,sp3,pluriel3)
		txt = ecritureLigne5Colonnes(txt,'Durcissante',ds,singulier,dp,pluriel,dp2,pluriel2,dp3,pluriel3)
		if args then -- pour "dor" et ses dérivés
			local ns = "n" .. mw.ustring.sub(singulier,2)
			local np = "n" .. mw.ustring.sub(pluriel,2)
			local np2 = "n" .. mw.ustring.sub(pluriel2,2)
			local np3 = "n" .. mw.ustring.sub(pluriel3,2)
			txt = ecritureLigne5Colonnes(txt,'Nasale',ns,singulier,np,pluriel,np2,pluriel2,np3,pluriel3)
		end
		txt = txt .. '|}'
		if not(mw.ustring.match(txt,'Adoucissante') or
			   mw.ustring.match(txt,'Spirante') or
			   mw.ustring.match(txt,'Durcissante')) then
			txt =
				'{| class="wikitable flextable"\n'..
				'! Singulier\n'..
				'! Pluriel 1\n'..
				'! Pluriel 2\n'..
				'! Pluriel 3\n'..
				'|-\n'..
				'| ]\n'..
				'| ]\n'..
				'| ]\n'..
				'| ]\n'..
				'|}'
		end
	elseif pluriel2 then
		ap2, sp2, dp2 = formes.formesMutees(pluriel2)
		ap,  sp,  dp  = formes.formesMutees(pluriel)
		txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		'! Singulier\n'..
		'! Pluriel 1\n'..
		'! Pluriel 2\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'..
		'| ]\n'..
		'| ]\n'
		txt = ecritureLigne4Colonnes(txt,'Adoucissante',as,singulier,ap,pluriel,ap2,pluriel2)
		txt = ecritureLigne4Colonnes(txt,'Spirante',ss,singulier,sp,pluriel,sp2,pluriel2)
		txt = ecritureLigne4Colonnes(txt,'Durcissante',ds,singulier,dp,pluriel,dp2,pluriel2)
		if args then -- pour "dor" et ses dérivés
			local ns = "n" .. mw.ustring.sub(singulier,2)
			local np = "n" .. mw.ustring.sub(pluriel,2)
			local np2 = "n" .. mw.ustring.sub(pluriel2,2)
			txt = ecritureLigne4Colonnes(txt,'Nasale',ns,singulier,np,pluriel,np2,pluriel2)
		end
		txt = txt .. '|}'
		if not(mw.ustring.match(txt,'Adoucissante') or
			   mw.ustring.match(txt,'Spirante') or
			   mw.ustring.match(txt,'Durcissante')) then
			txt =
				'{| class="wikitable flextable"\n'..
				'! Singulier\n'..
				'! Pluriel 1\n'..
				'! Pluriel 2\n'..
				'|-\n'..
				'| ]\n'..
				'| ]\n'..
				'| ]\n'..
				'|}'
		end
	elseif pluriel then
		ap,  sp,  dp  = formes.formesMutees(pluriel)
		txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		'! Singulier\n'..
		'! Pluriel\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'..
		'| ]\n'
		txt = ecritureLigne3Colonnes(txt,'Adoucissante',as,singulier,ap,pluriel)
		txt = ecritureLigne3Colonnes(txt,'Spirante',ss,singulier,sp,pluriel)
		txt = ecritureLigne3Colonnes(txt,'Durcissante',ds,singulier,dp,pluriel)
		if args then -- pour "dor" et ses dérivés
			local ns = "n" .. mw.ustring.sub(singulier,2)
			local np = "n" .. mw.ustring.sub(pluriel,2)
			txt = ecritureLigne3Colonnes(txt,'Nasale',ns,singulier,np,pluriel)
		end
		txt = txt .. '|}'
		if not(mw.ustring.match(txt,'Adoucissante') or
			   mw.ustring.match(txt,'Spirante') or
			   mw.ustring.match(txt,'Durcissante')) then
			txt =
				'{| class="wikitable flextable"\n'..
				'! Singulier\n'..
				'! Pluriel\n'..
				'|-\n'..
				'| ]\n'..
				'| ]\n'..
				'|}'
		end
	else
		txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		'! ' .. forme .. '\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'



		
		txt = ecritureLigne2Colonnes(txt,'Adoucissante',as,singulier)
		txt = ecritureLigne2Colonnes(txt,'Spirante',ss,singulier)
		txt = ecritureLigne2Colonnes(txt,'Durcissante',ds,singulier)
		if args then -- pour "dor" et ses dérivés
			local ns = "n" .. mw.ustring.sub(singulier,2)
			txt = ecritureLigne2Colonnes(txt,'Nasale',ns,singulier)
		end
		txt = txt .. '|}'
		if not(mw.ustring.match(txt,'Adoucissante') or
			   mw.ustring.match(txt,'Spirante') or
			   mw.ustring.match(txt,'Durcissante')) then
			txt =
				'{| class="wikitable flextable"\n'..
				'! ' .. forme .. '\n'..
				'|-\n'..
				'| ]\n'..
				'|}'
		end

	end	
	return txt
end

function p.boite_cs(frame) -- pour les noms ayant deux formes : collectif ; singulatif
	local args = frame:getParent().args
	local collectif  = args
	local singulatif = args
	singulatif = singulatif or collectif .. "enn"
	local ac, as, sc, ss, dc, ds = 
		nil, nil, nil, nil, nil, nil -- formes mutées : adoucissante ; spirante ; durcissante
	
	ac, sc, dc = formes.formesMutees(collectif)
	as, ss, ds = formes.formesMutees(singulatif)
	local txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		'! Collectif\n'..
		'! Singulatif\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'..
		'| ]\n'
	txt = ecritureLigne3Colonnes(txt,'Adoucissante',ac,collectif,as,singulatif)
	txt = ecritureLigne3Colonnes(txt,'Spirante',sc,collectif,ss,singulatif)
	txt = ecritureLigne3Colonnes(txt,'Durcissante',dc,collectif,ds,singulatif)
	txt = txt .. '|}'
	if not(mw.ustring.match(txt,'Adoucissante') or
		   mw.ustring.match(txt,'Spirante') or
		   mw.ustring.match(txt,'Durcissante')) then
		txt =
			'{| class="wikitable flextable"\n'..
			'! Collectif\n'..
			'! Singulatif\n'..
			'|-\n'..
			'| ]\n'..
			'| ]\n'..
			'|}'
	end
	return txt
end

function p.boite_csp(frame) -- pour les noms ayant trois formes : collectif ; singulatif ; pluriel
	local args = frame:getParent().args
	local collectif  = args
	local singulatif = args
	local pluriel    = args
	singulatif = singulatif or collectif .. "enn"
	pluriel = pluriel or singulatif .. "où"
	local ac, as, ap, sc, ss, sp, dc, ds, dp = 
		nil, nil, nil, nil, nil, nil, nil, nil, nil -- formes mutées : adoucissante ; spirante ; durcissante
	
	ac, sc, dc = formes.formesMutees(collectif)
	as, ss, ds = formes.formesMutees(singulatif)
	ap, sp, dp = formes.formesMutees(pluriel)
	local txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		'! Collectif\n'..
		'! Singulatif\n'..
		'! Pluriel\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'..
		'| ]\n'..
		'| ]\n'
	txt = ecritureLigne4Colonnes(txt,'Adoucissante',ac,collectif,as,singulatif,ap,pluriel)
	txt = ecritureLigne4Colonnes(txt,'Spirante',sc,collectif,ss,singulatif,sp,pluriel)
	txt = ecritureLigne4Colonnes(txt,'Durcissante',dc,collectif,ds,singulatif,dp,pluriel)
	txt = txt .. '|}'
	if not(mw.ustring.match(txt,'Adoucissante') or
		   mw.ustring.match(txt,'Spirante') or
		   mw.ustring.match(txt,'Durcissante')) then
		txt =
			'{| class="wikitable flextable"\n'..
			'! Collectif\n'..
			'! Singulatif\n'..
			'! Pluriel\n'..
			'|-\n'..
			'| ]\n'..
			'| ]\n'..
			'| ]\n'..
			'|}'
	end
	return txt
end

function p.boite_duel(frame) -- pour les noms ayant une forme duelle
	local args = frame:getParent().args
	local singulier = args
	local duel      = args
	local pluriel   = args
	local plurDuel  = args
	mot = {nil, nil, nil, nil}
	n = 1
	local txt1, txt2, txt3 = "", "", ""
	if singulier ~= "" then
		mot = singulier
		n = n + 1
		txt1 = txt1 .. '! Singulier\n'
	end
		mot = duel
		n = n + 1
		txt1 = txt1 .. '! Duel\n'
	if pluriel and (pluriel ~= "")  then
		mot = pluriel
		n = n + 1
		txt1 = txt1 .. '! Pluriel\n'
	end
	if plurDuel then
		mot = plurDuel
		n = n + 1
		txt1 = txt1 .. '! Pluriel duel\n'
	end
	
	local a1, a2, a3, a4, s1, s2, s3, s4, d1, d2, d3, d4 = 
		nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil -- formes mutées : adoucissante ; spirante ; durcissante
	
	a1, s1, d1 = formes.formesMutees(mot)
	if n == 2 then
		txt2 = 
		'|  .. '#br|' .. mot .. ']]\n'
		
		txt3 = ecritureLigne2Colonnes(txt3,'Adoucissante',a1,mot)
		txt3 = ecritureLigne2Colonnes(txt3,'Spirante',s1,mot)
		txt3 = ecritureLigne2Colonnes(txt3,'Durcissante',d1,mot)
	
	elseif n == 3 then
		a2, s2, d2 = formes.formesMutees(mot)
		txt2 = 
		'|  .. '#br|' .. mot .. ']]\n'..
		'|  .. '#br|' .. mot .. ']]\n'
		
		txt3 = ecritureLigne3Colonnes(txt3,'Adoucissante',a1,mot,a2,mot)
		txt3 = ecritureLigne3Colonnes(txt3,'Spirante',s1,mot,s2,mot)
		txt3 = ecritureLigne3Colonnes(txt3,'Durcissante',d1,mot,d2,mot)
	
	elseif n == 4 then
		a2, s2, d2 = formes.formesMutees(mot)
		a3, s3, d3 = formes.formesMutees(mot)
		txt2 = 
		'|  .. '#br|' .. mot .. ']]\n'..
		'|  .. '#br|' .. mot .. ']]\n'..
		'|  .. '#br|' .. mot .. ']]\n'
		
		txt3 = ecritureLigne4Colonnes(txt3,'Adoucissante',a1,mot,a2,mot,a3,mot)
		txt3 = ecritureLigne4Colonnes(txt3,'Spirante',s1,mot,s2,mot,s3,mot)
		txt3 = ecritureLigne4Colonnes(txt3,'Durcissante',d1,mot,d2,mot,d3,mot)
	
	elseif n == 5 then
		a2, s2, d2 = formes.formesMutees(mot)
		a3, s3, d3 = formes.formesMutees(mot)
		a4, s4, d4 = formes.formesMutees(mot)
		txt2 = 
		'|  .. '#br|' .. mot .. ']]\n'..
		'|  .. '#br|' .. mot .. ']]\n'..
		'|  .. '#br|' .. mot .. ']]\n'..
		'|  .. '#br|' .. mot .. ']]\n'
		
		txt3 = ecritureLigne5Colonnes(txt3,'Adoucissante',a1,mot,a2,mot,a3,mot,a4,mot)
		txt3 = ecritureLigne5Colonnes(txt3,'Spirante',s1,mot,s2,mot,s3,mot,s4,mot)
		txt3 = ecritureLigne5Colonnes(txt3,'Durcissante',d1,mot,d2,mot,d3,mot,d4,mot)
		
	end
	
	if txt3 == "" then
		txt = '{| class="wikitable flextable"\n' .. txt1 .. '|-\n' .. txt2 .. '|}'
	else
		txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
		txt1 ..
		'|-\n'..
		'! Non muté\n'..
		txt2 ..
		txt3 ..
		'|}'
	end
	return txt
end

function p.boite_pr(frame) -- pour les noms propres
	local args = frame:getParent().args
	local nom  = args or mw.title.getCurrentTitle().text
    local forme = args
	forme = forme or "Nom"
	local an, sn, dn = nil, nil, nil -- formes mutées : adoucissante ; spirante ; durcissante
	an, sn, dn = formes.formesMutees(nom)
	local txt =
		'{| class="wikitable flextable"\n'..
		'! Mutation\n'..
        '! ' .. forme .. '\n'..
		'|-\n'..
		'! Non muté\n'..
		'| ]\n'
	txt = ecritureLigne2Colonnes(txt,'Adoucissante',an,nom)
	txt = txt .. '|}'
	if not(mw.ustring.match(txt,'Adoucissante')) then
		txt =
			'{| class="wikitable flextable"\n'..
			'! Invariable\n'..
			'|-\n'..
			'| ]\n'..
			'|}'
	end
	return txt
end

return p