Module:CleTri
De MedFilm PPRD
La documentation pour ce module peut être créée à Module:CleTri/doc
local p = {}
local articles = {"La","Le","Les","L","Die","the","Lo"}
local l_articles ={}
for _,w in ipairs(articles) do
l_articles[w] = true
end
function p.fw(frame)
local words = mw.text.split(frame.args[1], "[_ ']")
if l_articles[words[1]] then
return "ok" --string.gsub(frame.args[1],#words[1],#frame.args[1])
else return frame.args[1]
end
-- return mw.text.split(frame.args[1], '[_ ]')[1]
end
function p.nom(frame)
local tpn = mw.text.split(frame.args[1], '[_ ]')
return(tpn[#tpn])
end
function p.transl(frame)
-- pn = string.gsub(frame.args[1], '^%s*(.-)%s*$', '%1')
pn = frame.args[1]
if dict[pn] then
return '[[' .. pn .. '|' .. dict[pn] .. ']]'
end
return '[[' .. pn .. ']]'
end
function p.translNoLink(frame)
-- pn = string.gsub(frame.args[1], '^%s*(.-)%s*$', '%1')
pn = frame.args[1]
if dict[pn] then
return dict[pn]
end
return pn
end
return p

