local lang = require("Module:languages").getByCode("akk")
local conj = require("Module:akk-conj")
local headword = require("Module:headword")
local export = {}
function get_root(args)
local title = mw.title.getCurrentTitle().text
local _, _, r1, r2, r3 = mw.ustring.find(title, "^(.)(.)(.)um$")
if r1 and r2 and r3 and not args.root then
args.root = r1 .. "-" .. r2 .. "-" .. r3
return {r1, r2 ,r3}
end
local _, _, r1, r2, r3 = mw.ustring.find(title, "^()(.)(.)um$")
if r1 and r2 and r3 and not args.root then
args.root = r1 .. "-" .. r2 .. "-" .. r3
return {r1, r2 ,r3}
end
local _, _, r1, r2, r3 = mw.ustring.find(title, "^()(.)(.)um$")
if r1 and r2 and r3 and not args.root then
args.root = r1 .. "-" .. r2 .. "-" .. r3
return {r1, r2 ,r3}
end
local _, _, r1, r2, r3 = mw.ustring.find(title, "^()(.)(.)um$")
if r1 and r2 and r3 and not args.root then
args.root = r1 .. "-" .. r2 .. "-" .. r3
return {r1, r2 ,r3}
end
local _, _, r1, r2, r3 = mw.ustring.find(title, "^(.)i?()(.)um$")
if r1 and r2 and r3 and not args.root then
r2 = mw.ustring.gsub(r2, "", "a")
r2 = mw.ustring.gsub(r2, "", "e")
args.root = r1 .. "-" .. r2 .. "-" .. r3
return {r1, r2 ,r3}
end
local _, _, r1, r2 = mw.ustring.find(title, "^(.)(.)ûm$")
if r1 and r2 and not args.root then
local r3 = mw.ustring.gsub(args.class, "i", "y")
r3 = mw.ustring.gsub(r3, "u", "w")
args.root = r1 .. "-" .. r2 .. "-" .. r3
return {r1, r2 , r3}
end
end
function export.main(frame)
local parent = frame:getParent()
local args = parent.args
args.stem = args
args.class = args
get_root(args)
inflections = {}
categories = {}
if args.stem then
table.insert(inflections, { label =']'})
table.insert(categories, "Akkadian " .. args.stem .."-stem verbs" )
else
table.insert(categories, "Akkadian verbs lacking stems")
end
if args.class then
table.insert(inflections, { label =']'})
table.insert(categories, "Akkadian class " .. args.class .." verbs" )
end
local dur = args.dur
local perf = args.perf
local pret = args.pret
local imp = args.imp
if args.stem == "G" and args.root then
local table_ = InflectionTable:from_args(args)
dur = dur or table_.dur
perf = perf or table_.perf
pret = pret or table_.pret
imp = imp or table_.imp
end
if dur then
table.insert(inflections, {label = "durative", dur})
end
if perf then
table.insert(inflections, {label = "perfect", perf })
end
if pret then
table.insert(inflections, {label = "preterite", pret})
end
if imp then
table.insert(inflections, {label = "imperative", imp})
end
return headword.full_headword({
lang = lang,
pos_category = "verbs",
inflections = inflections,
categories = categories
})
end
return export