Module:qay-noun: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 16: Line 16:
local NAMESPACE = mw.title.getCurrentTitle().nsText
local NAMESPACE = mw.title.getCurrentTitle().nsText


local genders = {["in"] = "inanimate", ["an"] = "animate", ["?"] = ""}
local genders = {["in"] = "inanimate", ["i"] = "inanimate", ["an"] = "animate", ["a"] = "animate", ["?"] = ""}


local function detect_decl(word)
local function detect_decl(word)
Line 37: Line 37:
local decl_type = parent_args[1] .. "_" .. detect_decl(word) or parent_args["decl"] or NAMESPACE == "Template" and "in_c"
local decl_type = parent_args[1] .. "_" .. detect_decl(word) or parent_args["decl"] or NAMESPACE == "Template" and "in_c"
if g ~= "in" and g ~= "an" and g ~= "?" then error("Unknown gender: it must be either ‘in’ or ‘an’") end
if not genders[g] then error("Unknown gender.") end
if not m_data[word] then
if not m_data[word] then