Module:pollasena-roots/templates: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same 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 164: | Line 164: | ||
local ancestor_codes = { | local ancestor_codes = { | ||
{code = "non", options = {}}, | {code = "non", options = {}}, | ||
{code = "gem-pro", options = {}}, | {code = "gem-pro", options = {optional = true}}, | ||
} | } | ||
Latest revision as of 11:26, 8 May 2026
- This module lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
local m_pr = require("Module:pollasena-roots")
local gsub = mw.ustring.gsub
local export = {}
local function concat_etymologies(args, etymologies)
local str = table.concat(etymologies, ", ") .. "."
if not args.nocap then
str = str:gsub("^.", mw.ustring.upper)
end
return str
end
function export.qsc(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "sekh", options = {}},
{code = "wasc", options = {optional = true, roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "qsc", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.lyti_inh(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "lyti-mid", options = {}},
{code = "lyti-old", options = {optional = true}},
{code = "cel-pro", options = {annotated = true, optional = true}},
{code = "ine-pro", options = {roots = true, optional = true}},
}
local evolution, args, categories = m_pr.parse_args(parent_args, "lyti", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.lyti_loan(frame)
local parent_args = frame:getParent().args
parent_args.borrowing = true
local source_code = parent_args[1] or "und"
local extra_params = {
mid = {type = "boolean"},
old = {type = "boolean"},
}
local ancestor_codes = {
{code = source_code, options = {borrowed = true}},
}
if parent_args.mid or parent_args.old then
table.insert(ancestor_codes, 1, {code = "lyti-mid", options = {optional = not parent_args.mid}})
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)
return concat_etymologies(args, evolution) .. categories
end
function export.gwax_wasc(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "wasc", options = {roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "gwax", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.gwax_nen(frame)
local parent_args = frame:getParent().args
parent_args.nocat = true -- no custom categories for Nentammmi
local ancestor_codes = {
{code = "nent-pro", options = {roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "gwax", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.guim(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "ine-pro", options = {roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "guim", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.sekh(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "wasc", options = {optional = true, roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "sekh", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.hzlc(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "wasc", options = {optional = true, roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "hzlc", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.soky(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "qsc", options = {}},
{code = "sekh", options = {optional = true}},
{code = "wasc", options = {optional = true, roots = true}}
}
local evolution, args, categories = m_pr.parse_args(parent_args, "soky", ancestor_codes)
return concat_etymologies(args, evolution) .. categories
end
function export.azms(frame)
local parent_args = frame:getParent().args
local ancestor_codes = {
{code = "azms-old", options = {optional = true}},
{code = "arto-pro", options = {optional = true}},
{code = "mish-pro", options = {optional = true}},
{code = "ine-pro", options = {optional = true, roots = true}}
}
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 = "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
end
return export