Module:lzz-conjugation

local export = {}

local dbg = require("Module:debug") local strutils = require("Module:string utilities") local conjugationTable = require("Module:lzz-conjugation/conjugation table")

-- Within this module, conjugation contain paradigms -- They are defined further down. local data = {}

--demistifying index -- screeve number = index // 6 -- person = (index % 6) % 3 -- singularity = (index % 6) / 3 --demistifying value. it is just a pair of prefix and suffix data["vavkz1.1"] = { screeves = { {p = "ბ", s = ""}, {p = "", s = ""}, {p = "", s = "ს"}, {p = "ბ", s = "თ"}, {p = "", s = "თ"}, {p = "", s = "ან"}, {p = "ვა", s = "ებდი"}, {p = "ა", s = "ებდი"}, {p = "ა", s = "ებდა"}, {p = "ვა", s = "ებდით"}, {p = "ა", s = "ებდით"}, {p = "ა", s = "ებდნენ"}, {p = "ვა", s = "ებდე"}, {p = "ა", s = "ებდე"}, {p = "ა", s = "ებდეს"}, {p = "ვა", s = "ებდეთ"}, {p = "ა", s = "ებდეთ"}, {p = "ა", s = "ებდნენ"}, {p = "(ა)ვა", s = "ებ"}, {p = "(ა)ა", s = "ებ"}, {p = "(ა)ა", s = "ებს"}, {p = "(ა)ვა", s = "ებთ"}, {p = "(ა)ა", s = "ებთ"}, {p = "(ა)ა", s = "ებენ"}, {p = "(ა)ვა", s = "ებდი"}, {p = "(ა)ა", s = "ებდი"}, {p = "(ა)ა", s = "ებდა"}, {p = "(ა)ვა", s = "ებდით"}, {p = "(ა)ა", s = "ებდით"}, {p = "(ა)ა", s = "ებდნენ"}, {p = "(ა)ვა", s = "ებდე"}, {p = "(ა)ა", s = "ებდე"}, {p = "(ა)ა", s = "ებდეს"}, {p = "(ა)ვა", s = "ებდეთ"}, {p = "(ა)ა", s = "ებდეთ"}, {p = "(ა)ა", s = "ებდნენ"}, {p = "(ა)ვა", s = "ე"}, {p = "(ა)ა", s = "ე"}, {p = "(ა)ა", s = "ა"}, {p = "(ა)ვა", s = "ეთ"}, {p = "(ა)ა", s = "ეთ"}, {p = "(ა)ა", s = "ეს"}, {p = "(ა)ვა", s = "ო"}, {p = "(ა)ა", s = "ო"}, {p = "(ა)ა", s = "ოს"}, {p = "(ა)ვა", s = "ოთ"}, {p = "(ა)ა", s = "ოთ"}, {p = "(ა)ა", s = "ონ"}, {p = "(ა)მი", s = "ებია"}, {p = "(ა)გი", s = "ებია"}, {p = "(ა)უ", s = "ებია"}, {p = "(ა)გვი", s = "ებია"}, {p = "(ა)გი", s = "ებიათ"}, {p = "(ა)უ", s = "ებიათ"}, {p = "(ა)მე", s = "ებინა"}, {p = "(ა)გე", s = "ებინა"}, {p = "(ა)ე", s = "ებინა"}, {p = "(ა)გვე", s = "ებინა"}, {p = "(ა)გე", s = "ებინათ"}, {p = "(ა)ე", s = "ებინათ"}, {p = "(ა)მე", s = "ებინოს"}, {p = "(ა)გე", s = "ებინოს"}, {p = "(ა)ე", s = "ებინოს"}, {p = "(ა)გვე", s = "ებინოს"}, {p = "(ა)გე", s = "ებინოთ"}, {p = "(ა)ე", s = "ებინოთ"} },	imperative = , leftStripLemmaSize = 1, rightStripLemmaSize = 3 }

local screeves = { ["present"] = 1, ["imperfect"] = 2, ["present subjunctive"] = 3, ["future"] = 4, ["conditional"] = 5, ["future subjunctive"] = 6, ["aorist"] = 7, ["optative"] = 8, ["perfect"] = 9, ["pluperfect"] = 10, ["perfect subjunctive"] = 11 }

function getAffixes(conjugation, formName, person, number) local index = (screeves[formName] - 1) * 6 if number == "pl" then index = index + 3 end index = index + person - 1 --mw.log(index) return conjugation["screeves"][index + 1] end

forms = {} function applyconjugation(conjugation, lemma) local stem = mw.ustring.sub(lemma, 1 + conjugation.leftStripLemmaSize, mw.ustring.len(lemma) - conjugation.rightStripLemmaSize) forms["lemma"] = lemma forms["perfective verbal noun"] = "" forms["imperfective verbal noun"] = "" forms["imperative2sg"] = "" forms["imperative3sg"] = "" forms["imperative2pl"] = "" forms["imperative3pl"] = "" for screeve, _ in pairs(screeves) do		for _, person in ipairs({1, 2, 3}) do 			for _, number in ipairs({"sg", "pl"}) do				local affixes = getAffixes(conjugation, screeve, person, number) local prefix = affixes.p;				local suffix = affixes.s; local name = screeve .. person .. number forms[name] = prefix .. stem .. suffix end end end end

-- The main entry point. -- This is the only function that can be invoked from a template. function export.main(frame) local args = frame:getParent.args local class = args["1"] lemma = args.term or mw.title.getCurrentTitle.text --PAGENAME applyconjugation(data[class], lemma) --return dbg.dump(forms) return strutils.format(conjugationTable.template, forms) end

return export