Module:category tree/affixes and compounds: Difference between revisions
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 219: | Line 219: | ||
table.insert(handlers, function(data) | table.insert(handlers, function(data) | ||
local labelpref, pos, affixtype, term_and_id = data.label:match("^(([ | local labelpref, pos, affixtype, term_and_id = data.label:match("^(([a-z -]+) ([a-z]+fix)ed with )(.+)$") | ||
if affixtype then | if affixtype then | ||
local term, id = term_and_id:match("^(.+) %(([^()]+)%)$") | local term, id = term_and_id:match("^(.+) %(([^()]+)%)$") | ||
| Line 270: | Line 270: | ||
local parents = {} | local parents = {} | ||
if id then | if id then | ||
if pos == " | if pos == "terms" or pos == "words" then | ||
table.insert(parents, {name = labelpref .. term, sort = id, args = args}) | table.insert(parents, {name = labelpref .. term, sort = id, args = args}) | ||
else | else | ||
table.insert(parents, {name = " | table.insert(parents, {name = pos .. " " .. affixtype .. "ed with " .. term_and_id, sort = id .. ", " .. pos, args = args}) | ||
table.insert(parents, {name = labelpref .. term, sort = id, args = args}) | table.insert(parents, {name = labelpref .. term, sort = id, args = args}) | ||
end | end | ||
elseif pos ~= "terms" then | elseif pos ~= "terms" then | ||
table.insert(parents, {name = "terms " .. affixtype .. "ed with " .. term, sort = pos, args = args}) | table.insert(parents, {name = "terms " .. affixtype .. "ed with " .. term, sort = pos, args = args}) | ||