2,788
edits
No edit summary |
No edit summary |
||
Line 50: | Line 50: | ||
if ((not data.inflections) and (not data.labels)) or (#data.inflections < 1 and #data.labels < 1) then return nil end | if ((not data.inflections) and (not data.labels)) or (#data.inflections < 1 and #data.labels < 1) then return nil end | ||
local out = {} | local out = {} | ||
for _, inflection in pairs(data.inflections) do | if data.inflections then | ||
for _, inflection in pairs(data.inflections) do | |||
if not inflection.label then error("headword inflection must have a label") end | |||
local i_forms = {} | |||
local i = 1 | |||
while inflection[i] do | |||
table.insert(i_forms, m_links.full_link({term = inflection[i], language = data.language}, "bold")) | |||
i = i + 1 | |||
end | |||
if #i_forms > 0 then | |||
table.insert(out, "''" .. inflection.label .. "'' " .. table.concat(i_forms, ", ")) | |||
end | |||
end | end | ||
end | |||
table.insert(out, "''" .. | if data.labels then | ||
for _, label in ipairs(data.labels) do | |||
table.insert(out, "''" .. "[[Appendix:Glossary#" .. label .. "|" .. label .. "]]''") | |||
end | end | ||
end | end | ||
if #out < 1 then return nil end | if #out < 1 then return nil end |