Module:akk-conj/g/stem/testcases

local akk_conj = require('Module:akk-conj') local tests = require('Module:UnitTests')

function table.is_subset(C1, C2) local out = true for index, value in pairs(C1) do       out = out and value == C2[index] end return out end

function tests:check(value, expected) self:equals("infinitive "..value.inf, value.inf, expected.inf) self:equals("participle "..value.inf, value.part, expected.part) self:equals("adjective "..value.inf, value.adj, expected.adj) local labels = {"1.sg", "2.sg.m", "2.sg.f", "3.sg", "1.pl", "2.pl", "3.pl.m", "3.pl.f"} local tenses = {"dur", "pret", "perf", "imp"} for _,tense in ipairs(tenses) do     for i,label in ipairs(labels) do         self:equals(tense.." "..label.." "..value.inf, value[tense][i], expected[tense][i]) end end end

local function get_table(params) params["stem"] = params["stem"] or "G" return InflectionTable:from_args(params) end function tests:test_gstem for _,expected in pairs(tests.g) do     local value = get_table(expected.params) self:check(value, expected) end end

tests.g = { ["parāsum"] = { params = {stem="G", root="p-r-s", class="a-u"}, inf   = "parāsum", part  = "pārisum", adj   = "parsum", dur   = {"aparras","taparras","taparrasī","iparras","niparras","taparrasā","iparrasū","iparrasā",}, pret  = {"aprus","taprus","taprusī","iprus","niprus","taprusā","iprusū","iprusā",}, perf  = {"aptaras","taptaras","taptarsī","iptaras","niptaras","taptarsā","iptarsū","iptarsā",}, imp   = {"luprus","purus","pursī","liprus","i niprus","pursā","liprusū","liprusā",}, },

["amārum"] = { params = {stem="G", root="a-m-r", class="a-u"}, inf   = "amārum", part  = "āmirum", adj   = "amrum", dur   = {"ammar","tammar","tammarī","immar","nimmar","tammarā","immarū","immarā",}, pret  = {"āmur","tāmur","tāmurī","īmur","nīmur","tāmurā","īmurū","īmurā",}, perf  = {"ātamar","tātamar","tātamrī","ītamar","nītamar","tātamrā","ītamrū","ītamrā",}, imp   = {"lūmur","amur","amrī","līmur","i nīmur","amrā","līmurū","līmurā",}, },  ["arākum"] = { params = {stem="G", root="a-r-k", class="i"}, inf   = "arākum", part  = "ārikum", adj   = "arkum", dur   = {"arrik","tarrik","tarrikī","irrik","nirrik","tarrikā","irrikū","irrikā",}, pret  = {"ārik","tārik","tārikī","īrik","nīrik","tārikā","īrikū","īrikā",}, perf  = {"ātarik","tātarik","tātarkī","ītarik","nītarik","tātarkā","ītarkū","ītarkā",}, imp   = {"lūrik","arik","arkī","līrik","i nīrik","arkā","līrikū","līrikā",}, },  ["watārum"] = { params = {stem="G", root="w-t-r", class="i"}, inf   = "watārum", part  = "wātirum", adj   = "watrum", dur   = {"ettir","tettir","tettirī","ittir","nittir","tettirā","ittirū","ittirā",}, pret  = {"ētir","tētir","tētirī","ītir","nītir","tētirā","ītirū","ītirā",}, perf  = {"ētetir","tētetir","tētetrī","ītetir","nītetir","tētetrā","ītetrū","ītetrā",}, imp   = {"-", "-","-","-","-","-","-","-",}, },  ["akāšum"] = { params = {stem="G", root="a-k-š", class="u"}, inf   = "akāšum", part  = "ākišum", adj   = "akšum", dur   = {"akkuš","takkuš","takkušī","ikkuš","nikkuš","takkušā","ikkušū","ikkušā",}, pret  = {"ākuš","tākuš","tākušī","īkuš","nīkuš","tākušā","īkušū","īkušā",}, perf  = {"ātakuš","tātakuš","tātakšī","ītakuš","nītakuš","tātakšā","ītakšū","ītakšā",}, imp   = {"lūkuš","akuš","akšī","līkuš","i nīkuš","akšā","līkušū","līkušā",}, },  ["epēšum"] = { params = {stem="G", root="e-p-š", class="a-u"}, inf   = "epēšum", part  = "ēpišum", adj   = "epšum", dur   = {"eppeš","teppeš","teppešī","ippeš","nippeš","teppešā","ippešū","ippešā",}, pret  = {"ēpuš","tēpuš","tēpušī","īpuš","nīpuš","tēpušā","īpušū","īpušā",}, perf  = {"ētepeš","tētepeš","tētepšī","ītepeš","nītepeš","tētepšā","ītepšū","ītepšā",}, imp   = {"lūpuš","epuš","epšī","līpuš","i nīpuš","epšā","līpušū","līpušā",}, },  ["ezēbum"] = { params = {stem="G", root="e-z-b", class="i"}, inf = "ezēbum", part = "ēzibum", adj = "ezbum", dur = {"ezzib","tezzib","tezzibī","izzib","nizzib","tezzibā","izzibū","izzibā",}, pret = {"ēzib","tēzib","tēzibī","īzib","nīzib","tēzibā","īzibū","īzibā",}, perf = {"ētezib","tētezib","tētezbī","ītezib","nītezib","tētezbā","ītezbū","ītezbā",}, imp = {"lūzib","ezib","ezbī","līzib","i nīzib","ezbā","līzibū","līzibā",}, },  ["erēbum"] = { params = {stem="G", root="e-r-b", class="u"}, inf   = "erēbum", part   = "ēribum", adj  = "erbum", dur   = {"erreb","terreb","terrebī","irreb","nirreb","terrebā","irrebū","irrebā",}, pret  = {"ērub","tērub","tērubī","īrub","nīrub","tērubā","īrubū","īrubā",}, perf  = {"ētereb","tētereb","tēterbī","ītereb","nītereb","tēterbā","īterbū","īterbā",}, imp   = {"lūrub","erub","erbī","līrub","i nīrub","erbā","līrubū","līrubā",}, },  ["naqārum"] = { params = {stem="G", root="n-q-r", class="a-u"}, inf   = "naqārum", part  = "nāqirum", adj   = "naqrum", dur   = {"anaqqar","tanaqqar","tanaqqarī","inaqqar","ninaqqar","tanaqqarā","inaqqarū","inaqqarā",}, pret  = {"aqqur","taqqur","taqqurī","iqqur","niqqur","taqqurā","iqqurū","iqqurā",}, perf  = {"attaqar","tattaqar","tattaqrī","ittaqar","nittaqar","tattaqrā","ittaqrū","ittaqrā",}, imp   = {"luqqur","uqur","uqrī","liqqur","i niqqur","uqrā","liqqurū","liqqurā",}, },  ["nakāsum"] = { params = {stem="G", root="n-k-s", class="i"}, inf   = "nakāsum", part  = "nākisum", adj   = "naksum", dur   = {"anakkis","tanakkis","tanakkisī","inakkis","ninakkis","tanakkisā","inakkisū","inakkisā",}, pret  = {"akkis","takkis","takkisī","ikkis","nikkis","takkisā","ikkisū","ikkisā",}, perf  = {"attakis","tattakis","tattaksī","ittakis","nittakis","tattaksā","ittaksū","ittaksā",}, imp   = {"lukkis","ikis","iksī","likkis","i nikkis","iksā","likkisū","likkisā",}, },  ["nasākum"] = { params = {stem="G", root="n-s-k", class="u"}, inf   = "nasākum", part  = "nāsikum", adj   = "naskum", dur   = {"anassuk","tanassuk","tanassukī","inassuk","ninassuk","tanassukā","inassukū","inassukā",}, pret  = {"assuk","tassuk","tassukī","issuk","nissuk","tassukā","issukū","issukā",}, perf  = {"attasuk","tattasuk","tattaskī","ittasuk","nittasuk","tattaskā","ittaskū","ittaskā",}, imp   = {"lussuk","usuk","uskī","lissuk","i nissuk","uskā","lissukū","lissukā",}, },  ["kânum"] = { params = {stem="G", root="k-a-n", class="a-u"}, inf   = "kânum", part  = "kāinum", adj   = "kīnum", dur   = {"akân","takân","takunnī","ikân","nikân","takunnā","ikunnū","ikunnā",}, pret  = {"akūn","takūn","takūnī","ikūn","nikūn","takūnā","ikūnū","ikūnā",}, perf  = {"aktūn","taktūn","taktūnī","iktūn","niktūn","taktūnā","iktūnū","iktūnā",}, imp   = {"lukūn","kūn","kūnī","likūn","i nikūn","kūnā","likūnū","likūnā",}, },  ["warādum"] = { params = {stem="G", root="w-r-d", class="a-i"}, inf   = "warādum", part  = "wāridum", adj   = "wardum", dur   = {"urrid","turrid","turridī","urrid","nurrid","turridā","urridū","urridā",}, pret  = {"urid","turid","turdī","urid","nurid","turdā","urdū","urdā",}, perf  = {"attarad","tattarad","tattardī","ittarad","nittarad","tattardā","ittardū","ittardā",}, imp   = {"lurid","rid","ridī","lirid","i nirid","ridā","lirdū","lirdā",}, },  ["šâlum"] = { params = {stem="G", root="š-a-l", class="a"}, inf   = "šâlum", part  = "šāilum", adj   = "šālum", dur   = {"ašâl","tašâl","tašallī","išâl","nišâl","tašallā","išallū","išallā",}, pret  = {"ašāl","tašāl","tašālī","išāl","nišāl","tašālā","išālū","išālā",}, perf  = {"aštāl","taštāl","taštālī","ištāl","ništāl","taštālā","ištālū","ištālā",}, imp   = {"lušāl","šāl","šālī","lišāl","i nišāl","šālā","lišālū","lišālā",}, },  ["qiāšum"] = { params = {stem="G", root="q-a-š", class = "a-i"}, inf   = "qiāšum", part  = "qāišum", adj   = "qīšum", dur   = {"aqīaš", "taqīaš", "taqiššī", "iqīaš", "niqīaš", "taqiššā", "iqiššū", "iqiššā",}, pret  = {"aqīš", "taqīš", "taqīšī", "iqīš", "niqīš", "taqīšā",  "iqīšū","iqīšā",}, perf  = {"aqtīš", "taqtīš", "taqtīšī", "iqtīš", "niqtīš", "taqtīšā",  "iqtīšū", "iqtīšā",}, imp   = {"luqīš", "qīš", "qīšī", "liqīš", "i niqīš", "qīšā", "liqīšū", "liqīšā"}, },  ["šêrum"] = { params = {stem="G", root="š-e-r", class="a"}, inf = "šêrum", part = "šēirum", adj = "šērum", dur = {"ešêr","tešêr","tešerrī","išêr","nišêr","tešerrā","išerrū","išerrā",}, pret = {"ešēr","tešēr","tešērī","išēr","nišēr","tešērā","išērū","išērā",}, perf = {"eštēr","teštēr","teštērī","ištēr","ništēr","teštērā","ištērū","ištērā",}, imp = {"lušēr","šēr","šērī","lišēr","i nišēr","šērā","lišērū","lišērā",}, },  ["ḫadûm"] = { params = {stem="G", root="ḫ-d-w"}, inf   = "ḫadûm", part  = "ḫādûm", adj   = "ḫadûm", dur   = {"aḫaddu","taḫaddu","taḫaddî","iḫaddu","niḫaddu","taḫaddâ","iḫaddû","iḫaddâ",}, pret  = {"aḫdu","taḫdu","taḫdî","iḫdu","niḫdu","taḫdâ","iḫdû","iḫdâ",}, perf  = {"aḫtadu","taḫtadu","taḫtadî","iḫtadu","niḫtadu","taḫtadâ","iḫtadû","iḫtadâ",}, imp   = {"luḫdu","ḫudu","ḫudî","liḫdu","i niḫdu","ḫudâ","liḫdû","liḫdâ",}, },  ["leqûm"] = { params = {stem="G", root="l-q-e"}, inf   = "leqûm", part  = "lēqûm", adj   = "leqûm", dur   = {"eleqqe","teleqqe","teleqqî","ileqqe","nileqqe","teleqqeā","ileqqû","ileqqeā",}, pret  = {"elqe","telqe","telqî","ilqe","nilqe","telqeā","ilqû","ilqeā",}, perf  = {"elteqe","telteqe","telteqî","ilteqe","nilteqe","telteqeā","ilteqû","ilteqeā",}, imp   = {"lulqe","leqe","leqî","lilqe","i nilqe","leqeā","lilqû","lilqeā",}, },  ["banûm"] = { params = {stem="G", root="b-n-y"}, inf   = "banûm", part  = "bānûm", adj   = "banûm", dur   = {"abanni","tabanni","tabannî","ibanni","nibanni","tabanniā","ibannû","ibanniā",}, pret  = {"abni","tabni","tabnî","ibni","nibni","tabniā","ibnû","ibniā",}, perf  = {"abtani","tabtani","tabtanî","ibtani","nibtani","tabtaniā","ibtanû","ibtaniā",}, imp   = {"lubni","bini","binî","libni","i nibni","biniā","libnû","libniā",}, },  ["malûm"] = { params = {stem="G", root="m-l-a"}, inf   = "malûm", part  = "mālûm", adj   = "malûm", dur   = {"amalla","tamalla","tamallî","imalla","nimalla","tamallâ","imallû","imallâ",}, pret  = {"amla","tamla","tamlî","imla","nimla","tamlâ","imlû","imlâ",}, perf  = {"amtala","tamtala","tamtalî","imtala","nimtala","tamtalâ","imtalû","imtalâ",}, imp   = {"lumla","mila","milî","limla","i nimla","milâ","limlû","limlâ",}, }, } return tests