Module:User:Victar/iir-decl-noun/data

local decl_data = {}

decl_data["a-m"] = { params = { [1] = {},		["nopl"] = {}, }, }

setmetatable(decl_data["a-m"], {__call = function(self, args, data)	local stem = args[1]	data.decl_type = "masculine a-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("ás")}	data.forms["voc_sg"] = {args[1] .. "a"}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("ám")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("ā́")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("ā́t")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("ā́y")}	data.forms["gen_sg"] = {args[1] .. destress_if_stressed("ásya")}	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("áy")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("ā́")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("áybʰyaH, -ā́bʰyām")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. destress_if_stressed("áyās")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("áyaw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("ā́, -ā́s(as)")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = {args[1] .. destress_if_stressed("ā́ns")} data.forms["ins_pl"] = {args[1] .. destress_if_stressed("ā́yš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("áybʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("ā́na(H)m")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("áyšu")} end table.insert(data.categories, "Proto-Indo-Iranian a-stem nouns") end })

decl_data["a-n"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["a-n"], {__call = function(self, args, data)	decl_data["a-m"](args, data)	data.decl_type = "neuter a-stem"

data.forms["nom_sg"] = data.forms["acc_sg"] data.forms["voc_sg"] = data.forms["acc_sg"] data.forms["nom_du"] = {args[1] .. destress_if_stressed("áy")} data.forms["voc_du"] = data.forms["nom_du"] data.forms["acc_du"] = data.forms["nom_du"]

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("áH")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] end end })

decl_data["cons-mf"] = { params = { [1] = {},		["nopl"] = {}, ["nomsg"] = {}, ["insdu"] = {}, ["inspl"] = {}, ["ablpl"] = {}, ["locpl"] = {}, }, } setmetatable(decl_data["cons-mf"], {__call = function(self, args, data)	local pagename = mw.title.getCurrentTitle.subpageText

local s = mw.ustring.sub(pagename, -1, -1) -- Check for s-stems if mw.ustring.sub(pagename, -1, -1) == "s" and not mw.ustring.find(mw.ustring.sub(pagename, -2, -2), "[fhkptþ]") then s = "" end

-- (mw.ustring.find(mw.ustring.sub(args[1], -1, -1), "[fhkptþ]") and "s" or "z") data.decl_type = "consonant stem" data.forms["nom_sg"] = {args.nomsg or (args[1] .. s)} data.forms["voc_sg"] = {args[1]} data.forms["acc_sg"] = {args[1] .. "ám"} data.forms["ins_sg"] = {args[1] .. "áH"} data.forms["abl_sg"] = {args[1] .. "ás"} data.forms["dat_sg"] = {args[1] .. "áy"} data.forms["gen_sg"] = data.forms["abl_sg"] data.forms["loc_sg"] = {args[1] .. "í"} data.forms["nom_du"] = {args.nomsg or (args[1] .. "ā́w")} data.forms["voc_du"] = data.forms["nom_du"] data.forms["acc_du"] = data.forms["nom_du"] data.forms["ins_du"] = {args.insdu or args[1] .. "bʰyáH, -bʰyā́m"} data.forms["abl_du"] = data.forms["ins_du"] data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. "áwš"} data.forms["loc_du"] = data.forms["gen_du"]

if not args.nopl then data.forms["nom_pl"] = {args.nomsg or (args[1] .. "ás")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] data.forms["ins_pl"] = {args.inspl or args[1] .. "bʰíš"} data.forms["abl_pl"] = {args.ablpl or args[1] .. "bʰyáH"} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. "ām"} data.forms["loc_pl"] = {args.locpl or args[1] .. "su"} end table.insert(data.categories, "Proto-Indo-Iranian consonant stem nouns") end })

decl_data["cons-n"] = { params = { [1] = {},		["nomsg"] = {}, ["nopl"] = {}, }, } setmetatable(decl_data["cons-n"], {__call = function(self, args, data)	decl_data["cons-mf"](args, data)	data.decl_type = "neuter consonant stem"

data.forms["nom_sg"] = {args.nomsg or (args[1])} data.forms["voc_sg"] = data.forms["nom_sg"] data.forms["acc_sg"] = data.forms["nom_sg"] if not args.nopl then data.forms["nom_pl"] = {args.nomsg or (args[1])} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] end end })

decl_data["i-mf"] = { params = { [1] = {},		["nopl"] = {}, ["g"] = {}, }, } setmetatable(decl_data["i-mf"], {__call = function(self, args, data)	data.decl_type = "masculine i-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("íš")}	data.forms["voc_sg"] = {args[1] .. destress_if_stressed("áy")}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("ím")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("íH́")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("áyš")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("áyay")}	data.forms["gen_sg"] = {args[1] .. destress_if_stressed("áyš")}	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("ā́(w)?")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("íH")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("íbʰyām")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. destress_if_stressed("yáwš")} data.forms["loc_du"] = data.forms["gen_du"]

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("áyas")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = {args[1] .. destress_if_stressed("ī́n, -ī́š")} data.forms["ins_pl"] = {args[1] .. destress_if_stressed("íbʰiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("íbʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("áyām?")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("íšu")} end if args.g == "f" then data.decl_type = "feminine i-stem" data.forms["ins_sg"] = {args[1] .. destress_if_stressed("(išt)yā́")} data.forms["abl_sg"] = {args[1] .. destress_if_stressed("áyš, *-yáš")} data.forms["loc_sg"] = {args[1] .. destress_if_stressed("ā́w, *-yā́")} data.forms["gen_du"] = {args[1] .. destress_if_stressed("yáwš")} data.forms["loc_du"] = data.forms["gen_du"] end table.insert(data.categories, "Proto-Indo-Iranian i-stem nouns") end })

decl_data["i-n"] = { params = { [1] = {},		["nopl"] = {}, ["j"] = {}, }, } setmetatable(decl_data["i-n"], {__call = function(self, args, data)	decl_data["i-m"](args, data)	data.decl_type = "neuter i-stem"	data.forms["nom_sg"] = data.forms["voc_sg"]	data.forms["acc_sg"] = data.forms["voc_sg"]

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("ī")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] end end })

decl_data["iH-f"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["iH-f"], {__call = function(self, args, data)	data.decl_type = "feminine iH-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("íHs")}	data.forms["voc_sg"] = {args[1] .. destress_if_stressed("í")}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("íyam")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("íyáH")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("íyas")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("íyay")}	data.forms["gen_sg"] = data.forms["abl_sg"]	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("íyi")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("íyaH́")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("íHbʰyaH")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. destress_if_stressed("íyaHs")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("íyaw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("íyas")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] data.forms["ins_pl"] = {args[1] .. destress_if_stressed("íHbʰiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("íHbʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("íHām")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("íHsu")} end table.insert(data.categories, "Proto-Indo-Iranian iH-stem nouns") end })

decl_data["aH-f"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["aH-f"], {__call = function(self, args, data)	data.decl_type = "aH-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("áH")}	data.forms["voc_sg"] = {args[1] .. "ay"}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("ā́m")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("áyaH́")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("áyaHs")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("áyaHy")}	data.forms["gen_sg"] = data.forms["abl_sg"]	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("áyaH(m)")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("áy")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("áHbʰyā(m)")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"]	data.forms["gen_du"] = {args[1] .. destress_if_stressed("āyās")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("āyaw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("ā́s")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] data.forms["ins_pl"] = {args[1] .. destress_if_stressed("áHbʰiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("áHbʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("áHnām")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("áHsu")} end table.insert(data.categories, "Proto-Indo-Iranian aH-stem nouns") end })

decl_data["yaH-f"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["yaH-f"], {__call = function(self, args, data)	data.decl_type = "yaH-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("íH")}	data.forms["voc_sg"] = data.forms["nom_sg"]	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("íHm")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("yáH")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("yáHs")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("yáy")}	data.forms["gen_sg"] = data.forms["abl_sg"]	data.forms["loc_sg"] = data.forms["ins_sg"]	data.forms["nom_du"] = {args[1] .. destress_if_stressed("íH")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("íHbʰyā(m)")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"]	data.forms["gen_du"] = {args[1] .. destress_if_stressed("íyās")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("íyaw")} if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("íH́s")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = data.forms["nom_pl"] data.forms["ins_pl"] = {args[1] .. destress_if_stressed("íHbʰiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("íHbʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("íHnām")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("íHsu")} end table.insert(data.categories, "Proto-Indo-Iranian yaH-stem nouns") end })

decl_data["uH-f"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["uH-f"], {__call = function(self, args, data)	data.decl_type = "uH-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("úHs")}	data.forms["voc_sg"] = {args[1] .. "u"}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("úwam")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("úwaH")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("úwas")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("úway")}	data.forms["gen_sg"] = data.forms["abl_sg"]	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("úwi")}	if not args.nopl then		data.forms["nom_pl"] = {args[1] .. destress_if_stressed("úwas")}		data.forms["voc_pl"] = data.forms["nom_pl"]		data.forms["acc_pl"] = data.forms["nom_pl"]		data.forms["ins_pl"] = {args[1] .. destress_if_stressed("úHbʰiš")}		data.forms["abl_pl"] = {args[1] .. destress_if_stressed("úHbʰyas")}		data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("úH́na(H)m")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("úHsu")} end table.insert(data.categories, "Proto-Indo-Iranian uH-stem nouns") end })

decl_data["u-mf"] = { params = { [1] = {},		["nopl"] = {}, ["g"] = {}, }, } setmetatable(decl_data["u-mf"], {__call = function(self, args, data)	data.decl_type = "masculine u-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("úš")}	data.forms["voc_sg"] = {args[1] .. destress_if_stressed("aw")}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("úm")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("úH́")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("áwš")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("áway")}	data.forms["gen_sg"] = data.forms["abl_sg"]	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("ā́(w)?")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("úH")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("úbʰyaH")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. destress_if_stressed("úwaHs")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("úwaw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("áwas")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = {args[1] .. destress_if_stressed("únš")} data.forms["ins_pl"] = {args[1] .. destress_if_stressed("úbʰiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("úbʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("únām?")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("úšu")} end table.insert(data.categories, "Proto-Indo-Iranian u-stem nouns") end })

decl_data["u-n"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["u-n"], {__call = function(self, args, data)	decl_data["u-mf"](args, data)	data.decl_type = "neuter u-stem"	data.forms["nom_sg"] = data.forms["voc_sg"]	data.forms["acc_sg"] = data.forms["voc_sg"]	if not args.nopl then		data.forms["nom_pl"] = data.forms["ins_sg"]		data.forms["voc_pl"] = data.forms["ins_sg"]		data.forms["acc_pl"] = data.forms["ins_sg"]	end end })

decl_data["n-n"] = { params = { [1] = {},		["nopl"] = {}, }, }

decl_data["r-n"] = { params = { [1] = {},		["nopl"] = {}, }, } setmetatable(decl_data["r-n"], {__call = function(self, args, data)	data.decl_type = "r-stem"	data.forms["nom_sg"] = {args[1] .. destress_if_stressed("ā́")}	data.forms["voc_sg"] = {args[1] .. "ar"}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("áram, *-ā́ram, *-r̥m")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("ráH")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("ŕ̥š, *-rás")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("ráy")}	data.forms["gen_sg"] = data.forms["abl_sg"]	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("ári")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("áraH, -ā́raH")}	data.forms["voc_du"] = data.forms["nom_du"]	data.forms["acc_du"] = data.forms["nom_du"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("ŕ̥bʰyā(m)")}	data.forms["abl_du"] = data.forms["ins_du"]	data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. destress_if_stressed("ráHs")} data.forms["gen_du"] = {args[1] .. destress_if_stressed("ráw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("áras, -ā́ras")} data.forms["voc_pl"] = data.forms["nom_pl"] data.forms["acc_pl"] = {args[1] .. destress_if_stressed("ŕ̥Nš")} data.forms["ins_pl"] = {args[1] .. destress_if_stressed("ŕ̥bʰiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("ŕ̥bʰyas")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("rā́m")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("ŕ̥šu")} end table.insert(data.categories, "Proto-Indo-Iranian r-stem nouns") end })

decl_data["irreg"] = {} setmetatable(decl_data["irreg"], {__call = function(self, args, data)	local word = mw.title.getCurrentTitle.subpageText	irreg_data = require("Module:User:Victar/iir-decl-noun/data/irreg")	if irreg_data.irreg[word] then		irreg_data.irreg[word](args, data)	else		error("Irregular inflection not found. Please check Module:iir-decl-noun/data.")	end	table.insert(data.categories, "Proto-Indo-Iranian irregular nouns") end })

return decl_data