Module:br-prép

Définition, traduction, prononciation, anagramme et synonyme sur le dictionnaire libre Wiktionnaire.

 Documentation[voir] [modifier] [historique] [purger]

Ce module permet de générer un tableau donnant les différentes formes conjuguées des prépositions bretonnes.

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

Il est appelé par le modèle {{br-prép}}. Voir celui-ci 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,mot,mot2)
	txt = txt ..
		'|-\n'..
		'! ' .. titre .. '\n'
	if mot2 then
		txt = txt .. '| [[' .. mot .. '#br|' .. mot .. ']]<br /><small>ou</small> [[' .. mot2 .. '#br|' .. mot2 .. ']]\n'
    elseif mot then
		txt = txt .. '| [[' .. mot .. '#br|' .. mot .. ']]\n'
    else
        txt = txt .. '| —\n'
	end
	return txt
end

function ecritureLigne3Colonnes(txt,titre,mot1,mot2,mot12,mot22)
	txt = txt ..
		'|-\n'..
		'! ' .. titre .. '\n'
	if mot1 then
		if mot12 then
			txt = txt .. '| [[' .. mot1 .. '#br|' .. mot1 .. ']]<br /><small>ou</small> [[' .. mot12 .. '#br|' .. mot12 .. ']]\n'
		else
			txt = txt .. '| [[' .. mot1 .. '#br|' .. mot1 .. ']]\n'
		end
	else
		txt = txt .. '| —\n'
	end
	if mot2 then
		if mot22 then
			txt = txt .. '| [[' .. mot2 .. '#br|' .. mot2 .. ']]<br /><small>ou</small> [[' .. mot22 .. '#br|' .. mot22 .. ']]\n'
		else
			txt = txt .. '| [[' .. mot2 .. '#br|' .. mot2 .. ']]\n'
		end
	else
		txt = txt .. '| —\n'
	end
	return txt
end

function conjugaison_1a(prep) -- hervez
	local S1  = prep .. 'on'
	local S2  = prep .. 'out'
	local S3m = prep .. 'añ'
	local S3f = prep .. 'i'
	local P1  = prep .. 'omp'
	local P2  = prep .. 'ocʼh'
	local P3  = prep .. 'o'
	local I   = prep .. 'or'
	local P3bis = prep .. 'e'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1b(prep) -- evit
	prep = mw.ustring.sub(prep,1,-2)
	local S1  = prep .. 'don'
	local S2  = prep .. 'dout'
	local S3m = prep .. 'tañ'
	local S3f = prep .. 'ti'
	local P1  = prep .. 'domp'
	local P2  = prep .. 'docʼh'
	local P3  = prep .. 'to'
	local I   = prep .. 'dor'
	local P3bis = prep .. 'te'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1c(prep) -- e
	local S1  = prep .. 'nnon'
	local S2  = prep .. 'nnout'
	local S3m = prep .. 'nnañ'
	local S3f = prep .. 'nni'
	local P1  = prep .. 'nnomp'
	local P2  = prep .. 'nnocʼh'
	local P3  = prep .. 'nno'
	local I   = prep .. 'nnor'
	local P3bis = prep .. 'nne'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1d(prep) -- war
	local S1  = prep .. 'non'
	local S2  = prep .. 'nout'
	local S3m = prep .. 'nañ'
	local S3f = prep .. 'ni'
	local P1  = prep .. 'nomp'
	local P2  = prep .. 'nocʼh'
	local P3  = prep .. 'no'
	local I   = prep .. 'nor'
	local S3mbis = prep .. 'nezhañ'
	local S3fbis = prep .. 'nezhi'
	local P3bis  = prep .. 'nezho'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil,S3mbis,S3fbis, nil, nil,P3bis
end

function conjugaison_1e(prep) -- e-giz
	if mw.ustring.sub(prep,-1) == 'z' then
		prep = mw.ustring.sub(prep,1,-2) .. 's'
	end
	local S1  = prep .. 'ton'
	local S2  = prep .. 'tout'
	local S3m = prep .. 'tañ'
	local S3f = prep .. 'ti'
	local P1  = prep .. 'tomp'
	local P2  = prep .. 'tocʼh'
	local P3  = prep .. 'to'
	local I   = prep .. 'tor'
	local P3bis = prep .. 'te'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1f(prep) -- evel
	local S1  = prep .. 'don'
	local S2  = prep .. 'dout'
	local S3m = prep .. 'tañ'
	local S3f = prep .. 'ti'
	local P1  = prep .. 'domp'
	local P2  = prep .. 'docʼh'
	local P3  = prep .. 'to'
	local I   = prep .. 'dor'
	local P3bis = prep .. 'te'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1g(prep) -- dre
	local S1  = prep .. 'zon'
	local S2  = prep .. 'zout'
	local S3m = prep .. 'zañ'
	local S3f = prep .. 'zi'
	local P1  = prep .. 'zomp'
	local P2  = prep .. 'zocʼh'
	local P3  = prep .. 'zo'
	local I   = prep .. 'zor'
	local P3bis = prep .. 'ze'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1h(prep) -- a-raok
	prep = mw.ustring.sub(prep,1,-2)
	local S1  = prep .. 'zon'
	local S2  = prep .. 'zout'
	local S3m = prep .. 'zañ'
	local S3f = prep .. 'zi'
	local P1  = prep .. 'zomp'
	local P2  = prep .. 'zocʼh'
	local P3  = prep .. 'zo'
	local I   = prep .. 'zor'
	local P3bis = prep .. 'ze'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_1i(prep) -- a
	local S1  = 'acʼhanon'
	local S2  = 'acʼhanout'
	local S3m = 'anezhañ'
	local S3f = 'anezhi'
	local P1  = 'acʼhanomp'
	local P2  = 'acʼhanocʼh'
	local P3  = 'anezho'
	local I   = 'acʼhanor'
	local P3bis = 'anezhe'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, nil, nil, P3bis, nil
end

function conjugaison_2a(prep) -- da
	prep = mw.ustring.sub(prep,1,-2)
	local S1  = prep .. 'in'
	local S2  = prep .. 'it'
	local S3m = prep .. 'ezhañ'
	local S3f = prep .. 'ezhi'
	local P1  = prep .. 'imp'
	local P2  = prep .. 'eocʼh'
	local P3  = prep .. 'ezho'
	local I   = prep .. 'eor'
	local P1bis  = prep .. 'eomp'
	local P3bis = prep .. 'ezhe'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, P1bis, nil, P3bis, nil
end

function conjugaison_2b(prep) -- gant
	prep = mw.ustring.sub(prep,1,-2)
	local S1  = prep .. 'in'
	local S2  = prep .. 'it'
	local S3m = prep .. 'tañ'
	local S3f = prep .. 'ti'
	local P1  = prep .. 'imp'
	local P2  = prep .. 'eocʼh'
	local P3  = prep .. 'to'
	local I   = prep .. 'eor'
	local P1bis  = prep .. 'eomp'
	local P3bis = prep .. 'te'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, P1bis, nil, P3bis, nil
end

function conjugaison_2c(prep) -- ouzh
	prep = mw.ustring.sub(prep,1,-3)
	local S1  = prep .. 'zhin'
	local S2  = prep .. 'zhit'
	local S3m = prep .. 'tañ'
	local S3f = prep .. 'ti'
	local P1  = prep .. 'zhimp'
	local P2  = prep .. 'zhocʼh'
	local P3  = prep .. 'to'
	local I   = prep .. 'zhor'
	local P1bis  = prep .. 'zhomp'
	local P3bis = prep .. 'te'
	return S1, S2, S3m, S3f, P1, P2, P3, I, nil, nil, nil, nil, P1bis, nil, P3bis, nil
end

function conjugaison_3(prep1, prep2)
	aprep2, sprep2, dprep2 = formes.formesMutees(prep2) -- adoucissement, spirantisation, durcissement
	local initiale = mw.ustring.sub(prep2,1,1)
	if prep1 == 'e' then
		prep1 = 'en'
	end
		
	local S1  = prep1 .. ' ma '
	local S2  = prep1 .. ' da '
	local S3m = prep1 .. ' e '
	local S3f = prep1 .. ' he '
	local P1  = prep1 .. ' hor '
	local P2  = prep1 .. ' ho '
	local P3  = prep1 .. ' o '
	local I   = prep1 .. ' ar '
	if initiale == 'l' then
		P1  = prep1 .. ' hol '
		I   = prep1 .. ' al '
	elseif mw.ustring.find('aeiouhndt',initiale) then
		P1  = prep1 .. ' hon '
		I   = prep1 .. ' an '
	end
	if prep1 == 'en' then
		S1  = 'em '
		S2  = 'ez '
		I   = 'e' .. mw.ustring.sub(I,-2)
		if mw.ustring.find('aeiou',initiale) then
			P2  = 'en hocʼh '
		end
	elseif prep1 == 'da' then
		S1  = 'da’m '
		S2  = 'da’z '
		S3m = 'd’e '
		S3f = 'd’he '
		P1  = 'd’' .. mw.ustring.sub(P1,-4)
		P2  = 'd’ho '
		P3  = 'd’o '
		I   = 'd’' .. mw.ustring.sub(I,-3)
	end
	S1  = S1  .. sprep2
	S3m = S3m .. aprep2
	S3f = S3f .. sprep2
	P2  = P2  .. dprep2
	P3  = P3  .. sprep2
	if initiale == 'k' then
		P1  = P1  .. sprep2
		I   = I   .. sprep2
	else
		P1  = P1  .. prep2
		I   = I   .. prep2
	end
	if prep1 == 'en' or prep1 == 'da' then
		S2  = S2  .. dprep2
	else
		S2  = S2  .. aprep2
	end
	return S1, S2, S3m, S3f, P1, P2, P3, I
end

function conjugaison(prep1,prep2)
	local S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
		nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
	if not mw.ustring.find(prep1,' ') then
		prep1 = mw.ustring.gsub(prep1, '-', '')
	end
	if prep2 == '1a' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1a(prep1)
	elseif prep2 == '1b' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1b(prep1)
	elseif prep2 == '1c' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1c(prep1)
	elseif prep2 == '1d' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1d(prep1)
	elseif prep2 == '1e' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1e(prep1)
	elseif prep2 == '1f' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1f(prep1)
	elseif prep2 == '1g' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1g(prep1)
	elseif prep2 == '1h' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1h(prep1)
	elseif prep2 == '1i' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_1i(prep1)
	elseif prep2 == '2a' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_2a(prep1)
	elseif prep2 == '2b' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_2b(prep1)
	elseif prep2 == '2c' then
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_2c(prep1)
	else
		S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis =
			conjugaison_3(prep1,prep2)
	end
	return S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis
end

function p.boite(frame)
	local args = frame:getParent().args
	local prep1 = args[1]
	local prep2 = args[2]
    local prep3 = args[3]
    local prep4 = args[4]
	local sauf = args["sauf"]
	sauf = sauf or ' '
	local S1 =  args["S1"]
	local S2 =  args["S2"]
	local S3m =  args["S3m"]
	local S3f =  args["S3f"]
	local P1 =  args["P1"]
	local P2 =  args["P2"]
	local P3 =  args["P3"]
	local I =  args["I"]
	local txt = 
		'{| class="flextable"\n'..
		'! Personne\n'
	if S1 or S2 or S3m or S3f or P1 or P2 or P3 or I then
		txt = txt ..
		'! Forme\n'
		if not mw.ustring.find(sauf,'S1') then
			txt = ecritureLigne2Colonnes(txt,'1<sup>re</sup> du sing.',S1,S1bis)
		end
		if not mw.ustring.find(sauf,'S2') then
			txt = ecritureLigne2Colonnes(txt,'2<sup>e</sup> du sing.',S2,S2bis)
		end
		if not mw.ustring.find(sauf,'S3m') then
			txt = ecritureLigne2Colonnes(txt,'3<sup>e</sup> masc. du sing.',S3m,S3mbis)
		end
		if not mw.ustring.find(sauf,'S3f') then
			txt = ecritureLigne2Colonnes(txt,'3<sup>e</sup> fém. du sing.',S3f,S3fbis)
		end
		if not mw.ustring.find(sauf,'P1') then
			txt = ecritureLigne2Colonnes(txt,'1<sup>re</sup> du plur.',P1,P1bis)
		end
		if not mw.ustring.find(sauf,'P2') then
			txt = ecritureLigne2Colonnes(txt,'2<sup>e</sup> du plur.',P2,P2bis)
		end
		if not mw.ustring.find(sauf,'P3') then
			txt = ecritureLigne2Colonnes(txt,'3<sup>e</sup> du plur.',P3,P3bis)
		end
		if not mw.ustring.find(sauf,'I') then
			txt = ecritureLigne2Colonnes(txt,'Impersonnel',I,Ibis)
		end
	elseif prep3 then
		local S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis = 
			conjugaison(prep1,prep2)
		local S1_2, S2_2, S3m_2, S3f_2, P1_2, P2_2, P3_2, I_2,
			S1bis_2, S2bis_2, S3mbis_2, S3fbis_2, P1bis_2, P2bis_2, P3bis_2, Ibis_2 = conjugaison(prep3,prep4)
		txt = txt ..
		'! Forme 1\n'..
		'! Forme 2\n'
		if not mw.ustring.find(sauf,'S1') then
			txt = ecritureLigne3Colonnes(txt,'1<sup>re</sup> du sing.',S1,S1_2,S1bis,S1bis_2)
		end
		if not mw.ustring.find(sauf,'S2') then
			txt = ecritureLigne3Colonnes(txt,'2<sup>e</sup> du sing.',S2, S2_2,S2bis, S2bis_2)
		end
		if not mw.ustring.find(sauf,'S3m') then
			txt = ecritureLigne3Colonnes(txt,'3<sup>e</sup> masc. du sing.',S3m, S3m_2,S3mbis, S3mbis_2)
		end
		if not mw.ustring.find(sauf,'S3f') then
			txt = ecritureLigne3Colonnes(txt,'3<sup>e</sup> fém. du sing.',S3f, S3f_2,S3fbis, S3fbis_2)
		end
		if not mw.ustring.find(sauf,'P1') then
			txt = ecritureLigne3Colonnes(txt,'1<sup>re</sup> du plur.',P1, P1_2,P1bis, P1bis_2)
		end
		if not mw.ustring.find(sauf,'P2') then
			txt = ecritureLigne3Colonnes(txt,'2<sup>e</sup> du plur.',P2, P2_2,P2bis, P2bis_2)
		end
		if not mw.ustring.find(sauf,'P3') then
			txt = ecritureLigne3Colonnes(txt,'3<sup>e</sup> du plur.',P3, P3_2,P3bis, P3bis_2)
		end
		if not mw.ustring.find(sauf,'I') then
			txt = ecritureLigne3Colonnes(txt,'Impersonnel',I, I_2,Ibis, Ibis_2)
		end

	else
		local S1, S2, S3m, S3f, P1, P2, P3, I, S1bis, S2bis, S3mbis, S3fbis, P1bis, P2bis, P3bis, Ibis = 
			conjugaison(prep1,prep2)
		txt = txt ..
		'! Forme\n'
		if not mw.ustring.find(sauf,'S1') then
			txt = ecritureLigne2Colonnes(txt,'1<sup>re</sup> du sing.',S1,S1bis)
		end
		if not mw.ustring.find(sauf,'S2') then
			txt = ecritureLigne2Colonnes(txt,'2<sup>e</sup> du sing.',S2,S2bis)
		end
		if not mw.ustring.find(sauf,'S3m') then
			txt = ecritureLigne2Colonnes(txt,'3<sup>e</sup> masc. du sing.',S3m,S3mbis)
		end
		if not mw.ustring.find(sauf,'S3f') then
			txt = ecritureLigne2Colonnes(txt,'3<sup>e</sup> fém. du sing.',S3f,S3fbis)
		end
		if not mw.ustring.find(sauf,'P1') then
			txt = ecritureLigne2Colonnes(txt,'1<sup>re</sup> du plur.',P1,P1bis)
		end
		if not mw.ustring.find(sauf,'P2') then
			txt = ecritureLigne2Colonnes(txt,'2<sup>e</sup> du plur.',P2,P2bis)
		end
		if not mw.ustring.find(sauf,'P3') then
			txt = ecritureLigne2Colonnes(txt,'3<sup>e</sup> du plur.',P3,P3bis)
		end
		if not mw.ustring.find(sauf,'I') then
			txt = ecritureLigne2Colonnes(txt,'Impersonnel',I,Ibis)
		end
	end
	txt = txt .. '|}'
	return txt

end

return p