Module:form of: Difference between revisions

Added slash functionality
mNo edit summary
(Added slash functionality)
Line 6: Line 6:
local function make_labels(inflections)
local function make_labels(inflections)
local out = {}
local out = {}
for _, inflection in ipairs(inflections) do
for i, inflection in ipairs(inflections) do
if m_data.aliases[inflection] then inflection = m_data.aliases[inflection] end
if m_data.aliases[inflection] then inflection = m_data.aliases[inflection] end
local l = m_data.labels[inflection]
local l = m_data.labels[inflection]
if i > 1 and inflection ~= "/" then
table.insert(out, " ")
end
if l then
if l then
local text = l.label or inflection
local text = l.label or inflection
Line 18: Line 21:
else
else
table.insert(out, inflection)
table.insert(out, inflection)
end
if inflections[i+1] and inflection ~= "/" then
table.insert(out, " ")
end
end
end
end
return table.concat(out, " ")
return table.concat(out)
end
end