Module:siwa-headword: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 14: Line 14:
local NAMESPACE = mw.title.getCurrentTitle().nsText
local NAMESPACE = mw.title.getCurrentTitle().nsText
local SUBPAGENAME = mw.title.getCurrentTitle().subpageText
local SUBPAGENAME = mw.title.getCurrentTitle().subpageText
local legal_gender = {
["in"] = true,
["an"] = true,
}


local gender_key = {
local gender_key = {
["i"] = "in",
["i"] = "in",
["a"] = "an",
["a"] = "an",
}
local verb_key = {
["adit"] = "agentive ditransitive",
["ai"] = "agentive intransitive",
["asubj"] = "agentive subjective",
["at"] = "agentive transitive",
["imp"] = "impersonal",
["udit"] = "unagentive ditransitive",
["ui"] = "unagentive intransitive",
["usubj"] = "unagentive subjective",
["ut"] = "unagentive transitive",
["utrans"] = "translative",
}
}


Line 88: Line 96:
["unc"] = {type = "boolean"},
["unc"] = {type = "boolean"},
["indecl"] = {type = "boolean"},
["indecl"] = {type = "boolean"},
["head"] = {},
["head"] = {default = PAGENAME},
}
}
Line 123: Line 131:
pos_functions.verbs = function(class, args, data)
pos_functions.verbs = function(class, args, data)
local params = {
local params = {
[1] = {list = "pres"},
[1] = {required = true},
[2] = {list = "subj"},
[2] = {list = "inf", required = true},
[3] = {list = "pp"},
[3] = {list = "p", required = true},
["head"] = {},
["head"] = {},
}
}
Line 132: Line 140:
data.heads = {args["head"]}
data.heads = {args["head"]}
table.insert(data.categories, "High Valyrian " .. data.pos_category)
if match(args.head, "/") then
local kinds = mw.text.split(args[1], "/")
else
local kinds = {args[1]}
end
for n, kind in ipairs(kinds) do
table.insert(data.inflections[n].label, verb_key[kind])
table.insert(data.categories, "Siwa " .. verb_key[kind] .. " verbs")
end
args[1] = require("Module:qhv-verb/head").fetch("act_ind_prs_1sg")
args[2].label = "infinitive"
args[2] = require("Module:qhv-verb/head").fetch("act_sub_prs_1sg")
args[3].label = "past"
args[3] = require("Module:qhv-verb/head").fetch("act_part_prf")
args[1].label = "first-person singular present indicative"
args[2].label = "first-person singular present subjunctive"
args[3].label = "perfect participle"
table.insert(data.inflections, args[1])
table.insert(data.inflections, args[2])
table.insert(data.inflections, args[2])
table.insert(data.inflections, args[3])
table.insert(data.inflections, args[3])

Navigation menu