Module:pollasena-roots: Difference between revisions
No edit summary Tags: Reverted Mobile edit Mobile web edit |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 148: | Line 148: | ||
required = not lang_options.optional, | required = not lang_options.optional, | ||
list = true, | list = true, | ||
} | } | ||
params["c"] = { | params["c"] = { | ||
| Line 182: | Line 181: | ||
else | else | ||
local terms | local terms | ||
local separator = | local separator = "" | ||
if lang_options.roots then | if lang_options.roots then | ||
local items = m_param_utils.parse_list_with_inline_modifiers_and_separate_params({ | local items = m_param_utils.parse_list_with_inline_modifiers_and_separate_params({ | ||
| Line 195: | Line 194: | ||
local root_index = 1 | local root_index = 1 | ||
for _, item in ipairs(items) do | for _, item in ipairs(items) do | ||
if item.alt and not match(item.alt, "^%*") and ancestor_lang:hasType("reconstructed") then | |||
item.alt = "*" .. item.alt | |||
end | |||
if item.term == "-" or item.term == "+" then | if item.term == "-" or item.term == "+" then | ||
separator = item.term | separator = item.term | ||
elseif item.term then | elseif item.term then | ||
if root_index > 1 and | if root_index > 1 and match(items[root_index - 1].term, "%-$") then -- no asterisk after hyphen | ||
if not item.alt then | if not item.alt then | ||
item.alt = item.term:gsub("^%*", "") | item.alt = item.term:gsub("^%*", "") | ||
| Line 252: | Line 255: | ||
sort_key = args.sort, | sort_key = args.sort, | ||
nocat = args.nocat, | nocat = args.nocat, | ||
conj = separator, | conj = lang_options.roots and separator or nil, | ||
} | } | ||