local export = {}
local pos_functions = {}
local lang = require("Module:languages").getByCode("moh")
-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
PAGENAME = mw.title.getCurrentTitle().text
local args = frame:getParent().args
local poscat = frame.args or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
local cat = args; if cat == "" then cat = nil end
local cat2 = args; if cat2 == "" then cat2 = nil end
local cat3 = args; if cat3 == "" then cat3 = nil end
local head = args; if head == "" then head = nil end
local data = {lang = lang, pos_category = cat or poscat, categories = {}, heads = {PAGENAME}, genders = {}, inflections = {}}
if cat2 then table.insert(data.categories, "Mohawk " .. cat2) end
if cat3 then table.insert(data.categories, "Mohawk " .. cat3) end
if pos_functions then
pos_functions(args, data)
end
return require("Module:headword").full_headword(data)
end
pos_functions = function(args, data)
-- joiner
local joiner = args
if joiner ~= nil then --categorize joiner
if joiner == "t" or joiner == "ht" or joiner == "’t" then
table.insert(data.categories, "Mohawk nouns with joiner " .. "-t-")
end
else joiner = ""
end
-- stem
local stem = args
if stem ~= nil then
table.insert(data.inflections, {label= "stem",{nolink=true, term = stem .. joiner}})
end
--locative
local loc = args
if loc ~= nil then
table.insert(data.inflections, {label= "locative", loc})
end
local pl = args
if pl ~= nil then
table.insert(data.inflections, {label= "plural", pl})
end
-- prefix
local prefix = args
if prefix ~= nil then
if prefix == "ka" or prefix == "k" then
table.insert(data.categories, "Mohawk terms prefixed with ka-")
elseif prefix == "o" then
table.insert(data.categories, "Mohawk terms prefixed with o-")
elseif prefix == "ska" then
table.insert(data.categories, "Mohawk singulative nouns")
end
end
-- suffix
local suffix = args
if suffix ~= nil then
if suffix == "on" or suffix == "k" then
table.insert(data.categories, "Mohawk -on nouns")
elseif suffix == "a’" or prefix == "-" then
table.insert(data.categories, "Mohawk -a’ nouns")
elseif suffix == "e’" then
table.insert(data.categories, "Mohawk -e’ nouns")
end
end
-- joiner
local gender = args
if gender ~= nil then
if gender == "m" then
table.insert(data.genders, "m")
elseif gender == "f" then
table.insert(data.genders, "f")
end
end
-- feminine
local fem = args
if fem ~= nil then
table.insert(data.inflections, {label= "feminine", fem})
end
-- masculine
local masc = args
if masc ~= nil then
table.insert(data.inflections, {label= "masculine", masc})
end
end
pos_functions = pos_functions
pos_functions = function(args, data)
local fut = args
if fut ~= nil and fut ~= "" then
table.insert(data.inflections, {label= "future",fut})
end
local perf = args
if perf ~= nil and perf ~= "" then
table.insert(data.inflections, {label= "perfect", perf})
end
local imp = args
if imp ~= nil and imp ~= "" then
table.insert(data.inflections, {label= "imperative", imp})
end
local reflexive = args
if reflexive ~= nil then
if reflexive == "at" then
table.insert(data.categories, "Mohawk middle verbs")
elseif reflexive == "atat" then
table.insert(data.categories, "Mohawk reflexive verbs")
end
end
local loc = args
if loc ~= nil then
if loc == "cis" then
table.insert(data.categories, "Mohawk terms prefixed with i-")
elseif loc == "trans" then
table.insert(data.categories, "Mohawk terms prefixed with t-")
end
end
local stem = args
if stem ~= nil and stem ~= "" then
table.insert(data.inflections, {label= "incorporating form", stem})
end
end
pos_functions = function(args, data)
local prefix = args
if prefix ~= nil then
if prefix == "agent" then
table.insert(data.categories, "Mohawk agent pronominal prefixes")
elseif prefix == "patient" then
table.insert(data.categories, "Mohawk patient pronominal prefixes")
elseif prefix == "transitive" then
table.insert(data.categories, "Mohawk transitive pronominal prefixes")
elseif prefix == "possessive" then
table.insert(data.categories, "Mohawk possessive prefixes")
else
table.insert(data.categories, "Mohawk prefixes")
end
end
end
pos_functions = function(args, data)
table.insert(data.categories, "Mohawk adverbs")
end
pos_functions = function(args, data)
table.insert(data.categories, "Mohawk numerals")
end
pos_functions = function(args, data)
table.insert(data.categories, "Mohawk conjunctions")
end
return export