Module:siwa-noun/data: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
local match = mw.ustring.match
local match = mw.ustring.match
local v = "([aeiouyůõảẻỉỏủỷę])"
local v = "([aeiouyůõảẻỉỏủỷę])"
local PAGENAME = mw.title.getCurrentTitle().text


local ine, ill, ela, ade, all, abl, loc
local ine, ill, ela, ade, all, abl, loc
Line 22: Line 23:
table.insert(data.categories, "Siwa a-declension nouns")
table.insert(data.categories, "Siwa a-declension nouns")
data.forms["u"] = {data.head}
data.forms["u"] = {PAGENAME}
if args.ld then
if args.ld then
Line 93: Line 94:
table.insert(data.categories, "Siwa e-declension nouns")
table.insert(data.categories, "Siwa e-declension nouns")
data.forms["u"] = {data.head}
data.forms["u"] = {PAGENAME}
if stem:match("[ae]$") then
if stem:match("[ae]$") then
Line 204: Line 205:
data.forms["ine"] = {}
data.forms["ine"] = {}
data.forms["u"] = {data.head}
data.forms["u"] = {PAGENAME}
if args.ld then
if args.ld then
Line 276: Line 277:
table.insert(data.categories, "Siwa o-declension nouns")
table.insert(data.categories, "Siwa o-declension nouns")
data.forms["u"] = {data.head}
data.forms["u"] = {PAGENAME}
if stem:match("[ae]$") then
if stem:match("[ae]$") then
Line 386: Line 387:
table.insert(data.categories, "Siwa u-declension nouns")
table.insert(data.categories, "Siwa u-declension nouns")
data.forms["u"] = {data.head}
data.forms["u"] = {PAGENAME}
if stem:match("[aei]$") then
if stem:match("[aei]$") then
Line 466: Line 467:
data.forms["ine"] = {}
data.forms["ine"] = {}
data.forms["u"] = {data.head}
data.forms["u"] = {PAGENAME}
if stem:match("a$") then
if stem:match("a$") then

Revision as of 14:22, 27 July 2021



local sub = mw.ustring.sub
local match = mw.ustring.match
local v = "([aeiouyůõảẻỉỏủỷę])"
local PAGENAME = mw.title.getCurrentTitle().text

local ine, ill, ela, ade, all, abl, loc
local cases = {"ine", "ill", "ela", "ade", "all", "abl"}
local ce = {"a", "ta", "ka", "ma", "bma", "ska"}

local m_com = require('Module:siwa-noun/common')

local data = {}

data["a"] = {
	params = {
		["nolen"] = {},
		["ld"] = {},
	},
}
setmetatable(data["a"], {__call = function(self, args, data)
	local stem = args.nolen and data.head or m_com.lenition(data.head)
	local s2, s3 = sub(stem, 1, -3), sub(stem, 1, -4)
	table.insert(data.categories, "Siwa a-declension nouns")
	
	data.forms["u"] = {PAGENAME}
	
	if args.ld then
		data.forms["m"] = {stem .. "ka"}
		loc = stem .. "ki"
	elseif stem:match(v.."mm.$") then
		data.forms["m"] = {s3 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
		loc = s3 .. (data.q == "s" and "mṡi" or data.q == "l" and "mki" or "kki")
	elseif stem:match(v.."nn.$") then
		data.forms["m"] = {s3 .. (data.q == "s" and "nka" or "kka")}
		loc = s3 .. (data.q == "s" and "nki" or "kki")
	elseif stem:match(v.."vv.$") then
		data.forms["m"] = {s3 .. "gga"}
		loc = s3 .. "ggi"
	elseif stem:match(v.."[lrs]k.$") then
		data.forms["m"] = {s2 .. "kka"}
		loc = s2 .. "kki"
	elseif stem:match(v.."m.$") then
		data.forms["m"] = {s2 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
		loc = s2 .. (data.q == "s" and "mṡi" or data.q == "l" and "mki" or "kki")
	elseif stem:match(v.."n.$") then
		data.forms["m"] = {s2 .. (data.q == "s" and "nka" or "kka")}
		loc = s2 .. (data.q == "s" and "nki" or "kki")
	elseif stem:match(v.."[pb].$") then
		data.forms["m"] = {s2 .. (data.q == "s" and "pra" or "ḍga")}
		loc = s2 .. (data.q == "s" and "pri" or "ḍgi")
	elseif stem:match(v.."[td].$") then
		data.forms["m"] = {s2 .. (data.q == "s" and "tra" or "rka")}
		loc = s2 .. (data.q == "s" and "tri" or "tṡi")
	elseif stem:match(v.."r.$") then
		data.forms["m"] = {s2 .. "hka"}
		loc = s2 .. "hki"
	elseif stem:match(v.."ṡṡ.$") then
		data.forms["m"] = {s2 .. "ka"}
		loc = s2 .. "ki"
	else
		data.forms["m"] = {stem .. "ka"}
		loc = stem .. "ki"
	end
	
	data.forms["ine"] = {(ine or loc) .. ce[1]}
	data.forms["ill"] = {(ill or loc) .. ce[2]}
	data.forms["ela"] = {(ela or loc) .. ce[3]}
	data.forms["ade"] = {(ade or loc) .. ce[4]}
	data.forms["all"] = {(all or loc) .. ce[5]}
	data.forms["abl"] = {(abl or loc) .. ce[6]}
	
	-- TODO: add alternative forms with table.insert
	for n, case in pairs(cases) do
		if stem:match(v.."nn.$") and data.q == "s" and not args.ld then
			table.insert(data.forms[case], s3 .. "nṡi" .. ce[n])
		elseif stem:match(v.."n.$") and data.q == "s" and not args.ld then
			table.insert(data.forms[case], s2 .. "nṡi" .. ce[n])
		elseif stem:match(v.."[pb].$") and data.q == "s" and not args.ld then
			table.insert(data.forms[case], s2 .. "pṡi" .. ce[n])
		end
	end
end
})

data["e"] = {
	params = {
		["nolen"] = {},
		["ld"] = {},
	},
}
setmetatable(data["e"], {__call = function(self, args, data)
	local stem = args.nolen and data.head or m_com.lenition(data.head)
	local s1, s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3), sub(stem, 1, -4)
	table.insert(data.categories, "Siwa e-declension nouns")
	
	data.forms["u"] = {PAGENAME}
	
	if stem:match("[ae]$") then
		if args.ld then
			data.forms["m"] = {stem .. "ri"}
			loc = stem .. "ri"
		elseif stem:match(v.."ts.$") then
			data.forms["m"] = {s3 .. "tsġi"}
			loc = s3 .. "tsġi"
		elseif stem:match(v.."ss.$") then
			data.forms["m"] = {s3 .. "sġi"}
			loc = s3 .. "sġi"
		elseif stem:match(v.."n.$") then
			data.forms["m"] = {s2 .. "di"}
			ill, ela, ade = s2 .. "h", s2 .. "h", s2 .. "h"
			all, abl = s2 .. "i", s2 .. "i"
			ine = s2 .. "di"
		elseif stem:match(v.."b.$") then
			data.forms["m"] = {s2 .. "pri", s2 .. "bġi"}
			loc = s2 .. "pṡi"
		elseif stem:match(v.."k.$") then
			data.forms["m"] = {s2 .. "ġi"}
			loc = s2 .. "ṡi"
		elseif stem:match(v.."m.$") then
			data.forms["m"] = {s2 .. "mmi"}
			loc = s2 .. "mmi"
		elseif stem:match(v.."v.$") then
			data.forms["m"] = {s2 .. "rri"}
			loc = s2 .. "rri"
		elseif stem:match(v.."t.$") then
			data.forms["m"] = {s2 .. "tri"}
			loc = s2 .. "tri"
		elseif stem:match(v.."s.$") then
			data.forms["m"] = {s2 .. "sġi"}
			loc = s2 .. "sġi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lli"}
			loc = s2 .. "lli"
		elseif stem:match(v.."[hġ].$") then
			data.forms["m"] = {s2 .. "ġgi"}
			loc = s2 .. "ġġi"
		else
			data.forms["m"] = {stem .. "ri"}
			loc = stem .. "ri"
		end
	elseif stem:match("[io]$") then
		if args.ld then
			data.forms["m"] = {s1 .. "ie"}
			loc = s1 .. "iei"
		elseif stem:match(v.."mm.$") then
			data.forms["m"] = {s3 .. "mme"}
			loc = s3 .. "mmei"
		elseif stem:match(v.."[mpbvnrlkg].$") then
			local stl = sub(stem, -2, -2)
			stl = stl:gsub("p", "b"); stl = stl:gsub("k", "g")
			data.forms["m"] = {s2 .. stl .. stl .. "e"}
			loc = s2 .. stl .. stl .. "ei"
		elseif stem:match("o$") then
			data.forms["m"] = {s1 .. "ue", s1 .. "obi"}
			loc = s1 .. "uei"
		else
			data.forms["m"] = {s1 .. "ie"}
			loc = s1 .. "iei"
		end
	elseif stem:match("[uyů].$") then
		if args.ld then
			data.forms["m"] = {stem .. "me"}
			loc = stem .. "mei"
		elseif stem:match(v.."mm.$") then
			data.forms["m"] = {s3 .. "mme"}
			loc = s3 .. "mme"
		elseif stem:match(v.."[mn].$") then
			data.forms["m"] = {s2 .. "mme"}
			loc = s2 .. "mme"
		elseif stem:match(v.."k.$") then
			data.forms["m"] = {s2 .. (data.q == "s" and "gme" or "hme")}
			loc = s2 .. (data.q == "s" and "gme" or "hme")
		else
			data.forms["m"] = {stem .. "me"}
			loc = stem .. "mei"
		end
	end
	
	data.forms["ine"] = {(ine or loc) .. ce[1]}
	data.forms["ill"] = {(ill or loc) .. ce[2]}
	data.forms["ela"] = {(ela or loc) .. ce[3]}
	data.forms["ade"] = {(ade or loc) .. ce[4]}
	data.forms["all"] = {(all or loc) .. ce[5]}
	data.forms["abl"] = {(abl or loc) .. ce[6]}
	
	-- TODO: add alternative forms with table.insert
	for n, case in pairs(cases) do
		if stem:match("[^mpbvnrlkg]o$") and not args.ld then
			table.insert(data.forms[case], s1 .. "obi" .. ce[n])
		end
	end
end
})

data["i"] = {
	params = {
		["nolen"] = {},
		["ld"] = {},
	},
}
setmetatable(data["i"], {__call = function(self, args, data)
	local stem = args.nolen and data.head or m_com.lenition(data.head)
	local s1, s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3), sub(stem, 1, -4)
	table.insert(data.categories, "Siwa i-declension nouns")
	data.forms["ine"] = {}
	
	data.forms["u"] = {PAGENAME}
	
	if args.ld then
		if stem:match("i$") then
			data.forms["m"] = {s1 .. "id"}
			ill, ela, ade = s1 .. "ih", s1 .. "ih", s1 .. "ih"
			ine = s1 .. "idi"
			all, abl = s1 .. "ỉ", s1 .. "ỉ"
			table.insert(data.forms["ine"], s1 .. "ỉa")
		else
			data.forms["m"] = {stem .. "di"}
			ill, ela, ade = stem .. "h", stem .. "h", stem .. "h"
			all, abl = stem .. "i", stem .. "i"
			ine = stem .. "di"
		end
	elseif stem:match(v.."[mn][mn].$") then
		data.forms["m"] = {s3 .. "ndi"}
		loc = s3 .. "ndi"
	elseif stem:match("[uo][mn].$") then
		data.forms["m"] = {s3 .. "õdi"}
		loc = s3 .. "õdi"
	elseif stem:match(v.."[mn].$") then
		data.forms["m"] = {s2 .. "ndi"}
		loc = s2 .. "ndi"
	elseif stem:match(v.."[vg].$") then
		data.forms["m"] = {s2 .. "ḍḍi"}
		if sub(stem, -2, -2) == "g" then table.insert(data.forms["m"], s2 .. "hdi") end
		ela, ade = s2 .. "ḍ", s2 .. "ḍ"
		ine, ill, all, abl = s2 .. "ḍḍi", s2 .. "ḍḍi", s2 .. "ḍḍi", s2 .. "ḍḍi"
	elseif stem:match(v.."s.$") then
		data.forms["m"] = {s2 .. "sti"}
		loc = s2 .. "sti"
	elseif stem:match(v.."[rhk].$") then
		data.forms["m"] = {s2 .. "hdi"}
		loc = s2 .. "hdi"
	elseif stem:match(v.."l.$") then
		data.forms["m"] = {s2 .. "ldi"}
		loc = s2 .. "ldi"
	elseif stem:match("i$") then
		data.forms["m"] = {s1 .. "id"}
		ill, ela, ade = s1 .. "ih", s1 .. "ih", s1 .. "ih"
		ine = s1 .. "idi"
		all, abl = s1 .. "ỉ", s1 .. "ỉ"
		table.insert(data.forms["ine"], s1 .. "ỉa")
	else
		data.forms["m"] = {stem .. "di"}
		ill, ela, ade = stem .. "h", stem .. "h", stem .. "h"
		all, abl = stem .. "i", stem .. "i"
		ine = stem .. "di"
	end
	
	table.insert(data.forms["ine"], (ine or loc) .. ce[1])
	data.forms["ill"] = {(ill or loc) .. ce[2]}
	data.forms["ela"] = {(ela or loc) .. ce[3]}
	data.forms["ade"] = {(ade or loc) .. ce[4]}
	data.forms["all"] = {(all or loc) .. ce[5]}
	data.forms["abl"] = {(abl or loc) .. ce[6]}
	
end
})

data["o"] = {
	params = {
		["nolen"] = {},
		["ld"] = {},
	},
}
setmetatable(data["o"], {__call = function(self, args, data)
	local stem = args.nolen and data.head or m_com.lenition(data.head)
	local s1, s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3), sub(stem, 1, -4)
	table.insert(data.categories, "Siwa o-declension nouns")
	
	data.forms["u"] = {PAGENAME}
	
	if stem:match("[ae]$") then
		if args.ld then
			data.forms["m"] = {stem .. "mo"}
			loc = stem .. "moi"
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "mmo"}
			loc = s3 .. "mmoi"
		elseif stem:match(v.."[bt].$") then
			data.forms["m"] = {s2 .. "bmo"}
			loc = s2 .. "bmoi"
		elseif stem:match(v.."[mvn].$") then
			data.forms["m"] = {s2 .. "mmo"}
			loc = s2 .. "mmoi"
		elseif stem:match(v.."[rhg].$") then
			data.forms["m"] = {s2 .. "hmo"}
			loc = s2 .. "hmoi"
		elseif stem:match(v.."k.$") then
			data.forms["m"] = {s2 .. (data.q == "s" and "gmo" or "hmo")}
			loc = s2 .. (data.q == "s" and "gmoi" or "hmoi")
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lmo"}
			loc = s2 .. "lmoi"
		else
			data.forms["m"] = {stem .. "mo"}
			loc = stem .. "moi"
		end
	elseif stem:match("i$") then
		if args.ld then
			data.forms["m"] = {stem .. "ko"}
			loc = stem .. "koi"
		elseif stem:match(v.."hhį.$") then
			data.forms["m"] = {sub(stem, 1, -5) .. "ṡko"}
			loc = sub(stem, 1, -5) .. "ṡkoi"
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "kko"}
			loc = s3 .. "kkoi"
		elseif stem:match(v.."[mnkg].$") then
			data.forms["m"] = {s2 .. "kko"}
			loc = s2 .. "kkoi"
		elseif stem:match(v.."[lrs]k.$") or stem:match(v.."sġ.$") then
			data.forms["m"] = {s2 .. "kko"}
			loc = s2 .. "kkoi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lko"}
			loc = s2 .. "lkoi"
		elseif stem:match(v.."[rh].$") then
			data.forms["m"] = {s2 .. "hko"}
			loc = s2 .. "hkoi"
		elseif stem:match(v.."ṡ.$") then
			data.forms["m"] = {s2 .. "ṡko"}
			loc = s2 .. "ṡkoi"
		else
			data.forms["m"] = {stem .. "ko"}
			loc = stem .. "koi"
		end
	elseif stem:match("[ouyů].$") then
		if args.ld then
			data.forms["m"] = {stem .. "ma"}
			ill, ela = stem .. "n", stem .. "n"
			ine, ade, all, abl = stem .. "mi", stem .. "mi", stem .. "mi", stem .. "mi"
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "mma"}
			loc = s3 .. "mmi"
		elseif stem:match(v.."[mnv].$") then
			data.forms["m"] = {s2 .. "mma"}
			loc = s2 .. "mmi"
		elseif stem:match(v.."[rhgk].$") then
			data.forms["m"] = {s2 .. "hma"}
			loc = s2 .. "hmi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lma"}
			loc = s2 .. "lmi"
		else
			data.forms["m"] = {stem .. "ma"}
			ill, ela = stem .. "n", stem .. "n"
			ine, ade, all, abl = stem .. "mi", stem .. "mi", stem .. "mi", stem .. "mi"
		end
	end
	
	data.forms["ine"] = {(ine or loc) .. ce[1]}
	data.forms["ill"] = {(ill or loc) .. ce[2]}
	data.forms["ela"] = {(ela or loc) .. ce[3]}
	data.forms["ade"] = {(ade or loc) .. ce[4]}
	data.forms["all"] = {(all or loc) .. ce[5]}
	data.forms["abl"] = {(abl or loc) .. ce[6]}
	
	-- TODO: add alternative forms with table.insert
	for n, case in pairs(cases) do
		if stem:match(v.."[mnkg]i$") and not args.ld then
			table.insert(data.forms[case], s2 .. "kki" .. ce[n])
		elseif (stem:match(v.."[lrs]ki$") or stem:match(v.."sġi$")) and not args.ld then
			table.insert(data.forms[case], s2 .. "kki" .. ce[n])
		end
	end
end
})

data["u"] = {
	params = {
		["nolen"] = {},
		["ld"] = {},
	},
}
setmetatable(data["u"], {__call = function(self, args, data)
	local stem = args.nolen and data.head or m_com.lenition(data.head) 
	local s1, s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3), sub(stem, 1, -4)
	table.insert(data.categories, "Siwa u-declension nouns")
	
	data.forms["u"] = {PAGENAME}
	
	if stem:match("[aei]$") then
		if args.ld then
			data.forms["m"] = {stem .. "mo"}
			loc = stem .. "moi"
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "mmo"}
			loc = s3 .. "mmoi"
		elseif stem:match(v.."[btpd].$") then
			data.forms["m"] = {s2 .. "bmo"}
			loc = s2 .. "bmoi"
		elseif stem:match(v.."[mvn].$") then
			data.forms["m"] = {s2 .. "mmo"}
			loc = s2 .. "mmoi"
		elseif stem:match(v.."[rhgk].$") then
			data.forms["m"] = {s2 .. "hmo"}
			loc = s2 .. "hmoi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lmo"}
			loc = s2 .. "lmoi"
		else
			data.forms["m"] = {stem .. "mo"}
			loc = stem .. "moi"
		end
	elseif stem:match("[ouyů]$") then
		if args.ld then
			data.forms["m"] = {stem .. "ma"}
			ill, ela = stem .. "n", stem .. "n"
			ine, ade, all, abl = stem .. "mi", stem .. "mi", stem .. "mi", stem .. "mi"
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "mma", s3 .. "mmo"}
			loc = s3 .. "mma"
		elseif stem:match(v.."[mnv].$") then
			data.forms["m"] = {s2 .. "mma", s2 .. "mmo"}
			loc = s2 .. "mmi"
		elseif stem:match(v.."[rhgk].$") then
			data.forms["m"] = {s2 .. "hma"}
			loc = s2 .. "hmi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lma"}
			loc = s2 .. "lmi"
		else
			data.forms["m"] = {stem .. "ma"}
			ill, ela = stem .. "n", stem .. "n"
			ine, ade, all, abl = stem .. "mi", stem .. "mi", stem .. "mi", stem .. "mi"
		end
	end
	
	data.forms["ine"] = {(ine or loc) .. ce[1]}
	data.forms["ill"] = {(ill or loc) .. ce[2]}
	data.forms["ela"] = {(ela or loc) .. ce[3]}
	data.forms["ade"] = {(ade or loc) .. ce[4]}
	data.forms["all"] = {(all or loc) .. ce[5]}
	data.forms["abl"] = {(abl or loc) .. ce[6]}
	
	-- TODO: add alternative forms with table.insert
	for n, case in pairs(cases) do
		if stem:match(v.."[mn][mn][oyuů]$") and not args.ld then
			table.insert(data.forms[case], s3 .. "mmoi" .. ce[n])
		elseif (stem:match(v.."[mn][oyuů]$") or stem:match(v.."sġi$")) and not args.ld then
			table.insert(data.forms[case], s2 .. "mmoi" .. ce[n])
		end
	end
end
})

data["y"] = {
	params = {
		["nolen"] = {},
		["ld"] = {},
	},
}
setmetatable(data["y"], {__call = function(self, args, data)
	local stem = args.nolen and data.head or m_com.lenition(data.head)
	local s1, s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3), sub(stem, 1, -4)
	table.insert(data.categories, "Siwa y-declension nouns")
	
	data.forms["ine"] = {}
	
	data.forms["u"] = {PAGENAME}
	
	if stem:match("a$") then
		if args.ld then
			data.forms["m"] = {stem .. "mo"}
			loc = stem .. "moi"
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "mmo"}
			loc = s3 .. "mmoi"
		elseif stem:match(v.."[mvn].$") then
			data.forms["m"] = {s2 .. "mmo"}
			loc = s2 .. "mmoi"
		elseif stem:match(v.."[rhgk].$") then
			data.forms["m"] = {s2 .. "hmo"}
			loc = s2 .. "hmoi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "lmo"}
			loc = s2 .. "lmoi"
		else
			data.forms["m"] = {stem .. "mo"}
			loc = stem .. "moi"
		end
	elseif stem:match("i$") then
		if args.ld then
			if stem:match("i$") then
				data.forms["m"] = {s1 .. "id"}
				ill, ela, ade = s1 .. "ih", s1 .. "ih", s1 .. "ih"
				ine = s1 .. "idi"
				all, abl = s1 .. "ỉ", s1 .. "ỉ"
				table.insert(data.forms["ine"], s1 .. "ỉa")
			else
				data.forms["m"] = {stem .. "di"}
				ill, ela, ade = stem .. "h", stem .. "h", stem .. "h"
				all, abl = stem .. "i", stem .. "i"
				ine = stem .. "di"
			end
		elseif stem:match(v.."[mn][mn].$") then
			data.forms["m"] = {s3 .. "ndi"}
			loc = s3 .. "ndi"
		elseif stem:match("[uo][mn].$") then
			data.forms["m"] = {s3 .. "õdi"}
			loc = s3 .. "õdi"
		elseif stem:match(v.."[mn].$") then
			data.forms["m"] = {s2 .. "ndi"}
			loc = s2 .. "ndi"
		elseif stem:match(v.."[vg].$") then
			data.forms["m"] = {s2 .. "ḍḍi"}
			if sub(stem, -2, -2) == "g" then table.insert(data.forms["m"], s2 .. "hdi") end
			ela, ade = s2 .. "ḍ", s2 .. "ḍ"
			ine, ill, all, abl = s2 .. "ḍḍi", s2 .. "ḍḍi", s2 .. "ḍḍi", s2 .. "ḍḍi"
		elseif stem:match(v.."s.$") then
			data.forms["m"] = {s2 .. "sti"}
			loc = s2 .. "sti"
		elseif stem:match(v.."[rhk].$") then
			data.forms["m"] = {s2 .. "hdi"}
			loc = s2 .. "hdi"
		elseif stem:match(v.."l.$") then
			data.forms["m"] = {s2 .. "ldi"}
			loc = s2 .. "ldi"
		elseif stem:match("i$") then
			data.forms["m"] = {s1 .. "id"}
			ill, ela, ade = s1 .. "ih", s1 .. "ih", s1 .. "ih"
			ine = s1 .. "idi"
			all, abl = s1 .. "ỉ", s1 .. "ỉ"
			table.insert(data.forms["ine"], s1 .. "ỉa")
		else
			data.forms["m"] = {stem .. "di"}
			ill, ela, ade = stem .. "h", stem .. "h", stem .. "h"
			all, abl = stem .. "i", stem .. "i"
			ine = stem .. "di"
		end
	end
	
	table.insert(data.forms["ine"], (ine or loc) .. ce[1])
	data.forms["ill"] = {(ill or loc) .. ce[2]}
	data.forms["ela"] = {(ela or loc) .. ce[3]}
	data.forms["ade"] = {(ade or loc) .. ce[4]}
	data.forms["all"] = {(all or loc) .. ce[5]}
	data.forms["abl"] = {(abl or loc) .. ce[6]}
	
end
})

return data