Module:pollasena-roots: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 33: Line 33:
local args = require("Module:parameters").process(frame:getParent().args, params)
local args = require("Module:parameters").process(frame:getParent().args, params)


local links = {}; local categories = {}
local links = {}; local categories = {}; local alts = {};
-- WIP
-- WIP
for i, item in ipairs(args[a]) do
for i, item in ipairs(args[a]) do
Line 55: Line 55:
if prefix == "a" then
if prefix == "a" then
table.insert(links, link(term, arg))
table.insert(links, link(term, arg))
table.insert(alts, arg)
elseif prefix == "c" then
elseif prefix == "c" then
table.insert(categories, "Soc'ul' terms from Wascotl *" .. arg)
table.insert(categories, "Soc'ul' terms from Wascotl *" .. arg)
table.insert(alts, term)
end
end
elseif prefix == "a" then
elseif prefix == "a" then
table.insert(links, link(term, arg))
table.insert(links, link(term, arg))
table.insert(categories, "Soc'ul' terms from Wascotl *" .. term)
table.insert(categories, "Soc'ul' terms from Wascotl *" .. term)
table.insert(alts, arg)
elseif prefix == "c" then
elseif prefix == "c" then
table.insert(links, link(term))
table.insert(links, link(term))
table.insert(categories, "Soc'ul' terms from Wascotl *" .. arg)
table.insert(categories, "Soc'ul' terms from Wascotl *" .. arg)
table.insert(alts, term)
end
end
end
end
Line 69: Line 73:
table.insert(links, link(args[a][i]))
table.insert(links, link(args[a][i]))
table.insert(categories, "Soc'ul' terms from Wascotl *" .. args[a][i])
table.insert(categories, "Soc'ul' terms from Wascotl *" .. args[a][i])
table.insert(alts, args[a][i])
end
end
if links[i-1] == "-" then links[i] = links[i]:gsub("%|%*","|") end
if (links[i-1] == "-" or alts[i-1]:match("-$")) then links[i] = links[i]:gsub("%|%*","|") end
end
end