Module:pollasena-roots: Difference between revisions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 121: | Line 121: | ||
separator = item.term | separator = item.term | ||
elseif item.term then | elseif item.term then | ||
if root_index > 1 and | if root_index > 1 and last_term ~= "+" then -- only subsequent asterisks afer space | ||
item.alt = gsub(item.alt or item.term, "^%*", "") | |||
end | end | ||
table.insert(terms, item) | table.insert(terms, item) | ||
local | local function one_asterisk(str) | ||
return "*" .. gsub(str, "^*+", "") | |||
end | |||
local cat_term = one_asterisk(args.c[root_index] or item.term) | |||
if code == "wasc" then -- Wascotl root and suffix handling | if code == "wasc" then -- Wascotl root and suffix handling | ||
local suffix = match(cat_term, "^*[%w']+(%-[%w']+)$") | local suffix = match(cat_term, "^*[%w']+(%-[%w']+)$") | ||
| Line 139: | Line 136: | ||
if wasc_suffixes[suffix] then | if wasc_suffixes[suffix] then | ||
cat_term = gsub(cat_term, suffix, "-") | cat_term = gsub(cat_term, suffix, "-") | ||
end | end | ||
end | end | ||