Module:pollasena-roots: Difference between revisions

No edit summary
No edit summary
Line 161: Line 161:
local args = m_param.process(parent_args, params)
local args = m_param.process(parent_args, params)


local dest_lang = lang_from_code(dest_code)
local dest_lang = m_lang.getByCode(dest_code)
local etymologies = {}
local etymologies = {}
Line 168: Line 168:
local code = ancestor.code
local code = ancestor.code
local lang_options = ancestor.options or {}
local lang_options = ancestor.options or {}
local ancestor_lang = lang_from_code(code)
local ancestor_lang = m_lang.getByCode(code)
local terms
local terms
Line 182: Line 182:
terms = {}
terms = {}
local root_index = 1
for _, item in ipairs(items) do
for _, item in ipairs(items) do
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 separator == "-" then -- no asterisk after hyphen
if not item.alt then
item.alt = item.term:gsub("^%*", "")
else
item.alt = item.alt:gsub("^%*", "")
end
item.no_alt_ast = true
end
table.insert(terms, item)
table.insert(terms, item)
root_index = root_index + 1
end
end
end
end