Module:head: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 8: Line 8:
local cats = "[[Category:" .. data.language.name .. " lemmas]]"
local cats = "[[Category:" .. data.language.name .. " lemmas]]"
cats = cats .. "[[Category:" .. data.language.name .. " " .. data.pos .. "s]]"
cats = cats .. "[[Category:" .. data.language.name .. " " .. data.pos .. "s]]"
local head = data.term
if data.head then
if data.head then
return m_formatting.wrap_face(data.head, data.language, "head"), cats
head = data.head
end
elseif string.find(head, " ") then
local head = data.term
if string.find(head, " ") then
local pieces = {}
local pieces = {}
for piece in string.gmatch(head, "%S+") do
for piece in string.gmatch(head, "%S+") do
Line 18: Line 17:
end
end
head = table.concat(pieces, " ")
head = table.concat(pieces, " ")
end
if string.find(head, " ") then
cats = cats .. "[[Category:" .. data.language.name .. " multiword terms]]"
end
end
return m_formatting.wrap_face(head, data.language, "head"), cats
return m_formatting.wrap_face(head, data.language, "head"), cats