Module:pollasena-roots/templates: Difference between revisions
No edit summary |
No edit summary |
||
| (6 intermediate revisions by one other user not shown) | |||
| Line 33: | Line 33: | ||
local ancestor_codes = { | local ancestor_codes = { | ||
{code = "lyti-mid", options = {}}, | {code = "lyti-mid", options = {}}, | ||
{code = "lyti-old", options = {}}, | {code = "lyti-old", options = {optional = true}}, | ||
{code = "cel-pro", options = {annotated = true}}, | {code = "cel-pro", options = {annotated = true, optional = true}}, | ||
{code = "ine-pro", options = {roots = true}}, | {code = "ine-pro", options = {roots = true, optional = true}}, | ||
} | } | ||
| Line 47: | Line 47: | ||
parent_args.borrowing = true | parent_args.borrowing = true | ||
local source_code = parent_args[1] or "und" | local source_code = parent_args[1] or "und" | ||
local extra_params = { | |||
mid = {type = "boolean"}, | |||
old = {type = "boolean"}, | |||
} | |||
local ancestor_codes = { | local ancestor_codes = { | ||
{code = source_code, options = {borrowed = true}}, | {code = source_code, options = {borrowed = true}}, | ||
} | } | ||
if parent_args.mid or parent_args.old then | |||
mid = { | table.insert(ancestor_codes, 1, {code = "lyti-mid", options = {optional = not parent_args.mid}}) | ||
old | if parent_args.old then | ||
table.insert(ancestor_codes, parent_args.mid and 2 or 1, {code = "lyti-old", options = {optional = not parent_args.old}}) | |||
end | |||
end | |||
local evolution, args, categories = m_pr.parse_args(parent_args, "lyti", ancestor_codes, extra_params) | local evolution, args, categories = m_pr.parse_args(parent_args, "lyti", ancestor_codes, extra_params) | ||
| Line 150: | Line 155: | ||
local evolution, args, categories = m_pr.parse_args(parent_args, "azms", ancestor_codes) | local evolution, args, categories = m_pr.parse_args(parent_args, "azms", ancestor_codes) | ||
return concat_etymologies(args, evolution) .. categories | |||
end | |||
function export.snon(frame) | |||
local parent_args = frame:getParent().args | |||
local ancestor_codes = { | |||
{code = "sdno", options = {optional = true}}, | |||
{code = "non", options = {}}, | |||
{code = "gem-pro", options = {optional = true}}, | |||
} | |||
local evolution, args, categories = m_pr.parse_args(parent_args, "snon", ancestor_codes) | |||
return concat_etymologies(args, evolution) .. categories | return concat_etymologies(args, evolution) .. categories | ||