Module:User:Holodwig21/ira-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("áh")}	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("áhya, áhyā")}	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("áybyaH")}	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āh")} data.forms["loc_du"] = data.forms["gen_du"]

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("ā́, -āhah")} 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("ā́yš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("áybyah")} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. destress_if_stressed("ā́naHm")} data.forms["loc_pl"] = {args[1] .. destress_if_stressed("áyšu, -áyšuwa")} end table.insert(data.categories, "Proto-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("ā́")} 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"] = {args[1] .. destress_if_stressed("áH, -án")} 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] .. "am"} data.forms["ins_sg"] = {args[1] .. "aH"} data.forms["abl_sg"] = {args[1] .. "ah"} data.forms["dat_sg"] = {args[1] .. "ay"} data.forms["gen_sg"] = data.forms["abl_sg"] data.forms["loc_sg"] = {args[1] .. "i"} 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] .. "byaH, -byām"} data.forms["abl_du"] = data.forms["ins_du"] data.forms["dat_du"] = data.forms["ins_du"] data.forms["gen_du"] = {args[1] .. "awš"} data.forms["loc_du"] = data.forms["gen_du"]

if not args.nopl then data.forms["nom_pl"] = {args.nomsg or (args[1] .. "ah")} 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] .. "biš"} data.forms["abl_pl"] = {args.ablpl or args[1] .. "byaH"} data.forms["dat_pl"] = data.forms["abl_pl"] data.forms["gen_pl"] = {args[1] .. "ām"} data.forms["loc_pl"] = {args.locpl or args[1] .. "hu"} end table.insert(data.categories, "Proto-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("í")}	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("ím")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("áuš")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("áuš")}	data.forms["dat_sg"] = {args[1] .. destress_if_stressed("áyš")}	data.forms["gen_sg"] = {args[1] .. destress_if_stressed("áyš")}	data.forms["loc_sg"] = {args[1] .. destress_if_stressed("ā́uw")}	data.forms["nom_du"] = {args[1] .. destress_if_stressed("íHy")}	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("íbyaH")}	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("íHyaH")} 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("íbiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("íbyah")} 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("íHh")}	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("íyah")}	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("íHbyaH")}	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("íyaHh")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("íyaw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("íyah")} 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("íHbiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("íHbyah")} 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("íHhu")} end table.insert(data.categories, "Proto-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"] = data.forms["nom_sg"]	data.forms["acc_sg"] = {args[1] .. destress_if_stressed("ā́m")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("áyaH")}	data.forms["abl_sg"] = data.forms["ins_sg"]	data.forms["dat_sg"] = data.forms["ins_sg"]	data.forms["gen_sg"] = data.forms["ins_sg"]	data.forms["loc_sg"] = data.forms["ins_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"]	data.forms["ins_du"] = {args[1] .. destress_if_stressed("áHbyā")}	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āH")}	data.forms["loc_du"] = {args[1] .. destress_if_stressed("āyaH")}

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"] data.forms["ins_pl"] = {args[1] .. destress_if_stressed("áHbiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("áHbyah")} 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("áHšuwaH")} end table.insert(data.categories, "Proto-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áHh")}	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("íHbyā(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āh")} 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́h")} 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("íHbiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("íHbyah")} 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("íHhu")} end table.insert(data.categories, "Proto-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("úHh")}	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("úwah")}	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("úwah")}		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("úHbiš")}		data.forms["abl_pl"] = {args[1] .. destress_if_stressed("úHbyah")}		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("úHhu")} end table.insert(data.categories, "Proto-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("úbyaH")}	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("úwaHh")} data.forms["loc_du"] = {args[1] .. destress_if_stressed("úwaw")}

if not args.nopl then data.forms["nom_pl"] = {args[1] .. destress_if_stressed("áwah")} 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("úbiš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("úbyah")} 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-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")}	data.forms["ins_sg"] = {args[1] .. destress_if_stressed("ráH")}	data.forms["abl_sg"] = {args[1] .. destress_if_stressed("ráh")}	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("ŕ̥byā(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áHh")} 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("árah, -ā́rah")} 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("ŕ̥biš")} data.forms["abl_pl"] = {args[1] .. destress_if_stressed("ŕ̥byah")} 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-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:Holodwig21/ira-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:ira-decl-noun/data.")	end	table.insert(data.categories, "Proto-Iranian irregular nouns") end })

return decl_data