A modult a Modul:accent qualifier/doc lapon tudod dokumentálni
local export = {}
local m_qualifier = require("Module:qualifier")
function export.format_qualifiers(qualifiers)
local m_data = mw.loadData("Module:accent qualifier/data")
if type(qualifiers) ~= "table" then
qualifiers = { qualifiers }
end
local accents = {}
local categories = {}
for _, accent in ipairs(qualifiers) do
local data
-- Replace an alias with the label that has a data table.
if m_data.aliases then
accent = m_data.aliases
end
-- Retrieve the label's data table.
if m_data.labels then
data = m_data.labels
end
-- Use the link and displayed text in the data table, if they exist.
if data then
if data.link then
table.insert(accents, "[[w:" .. data.link .. "|" ..
(data.display or data.link) .. "]]")
elseif data.display then
table.insert(accents, data.display)
end
--[[
if data then
if data.type == "sound change" then
table.insert(categories, lang:getCanonicalName() .. " terms with pronunciations exhibiting " .. accent)
end
end
]]
else
table.insert(accents, accent)
end
end
return m_qualifier.format_qualifier(accents)
end
-- Called by {{accent}} or {{a}}.
function export.show(frame)
local args = frame.getParent and frame:getParent().args or frame
if (not args or args == "") and mw.title.getCurrentTitle().nsText == "Template" then
return m_qualifier.format_qualifier{ '{{{1}}}' }
end
local params = {
= {required = true, list = true}
}
args = require("Module:parameters").process(args, params)
return export.format_qualifiers(args)
end
return export