Module:Ilo-headword

local export = {} local pos_functions = {}

local lang = require("Module:languages").getByCode("ilo") local PAGENAME = mw.title.getCurrentTitle.text local script = require("Module:scripts").findBestScript(PAGENAME, lang) -- Latn or Tglg

function export.show(frame)

local tracking_categories = {}

local args = frame:getParent.args local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")

local head = {} -- supports multiple headword if args["head"] or args[1] then table.insert(head, args["head"] or args[1]) end if args["head2"] or args[2] then table.insert(head, args["head2"] or args[2]) end if args["head3"] or args[3] then table.insert(head, args["head3"] or args[3]) end

local data = {lang = lang, sc = script, pos_category = poscat, categories = {}, heads = head, translits = {"-"}, inflections = {}} local baybayin = {label = "Baybayin spelling"} local sc_Tglg = require("Module:scripts").getByCode("Tglg") if args["b"] then table.insert(baybayin, { term = args["b"], sc = sc_Tglg }) end if args["b2"] then table.insert(baybayin, { term = args["b2"], sc = sc_Tglg }) end if args["b3"] then table.insert(baybayin, { term = args["b3"], sc = sc_Tglg }) end if #baybayin > 0 then table.insert(data.inflections, baybayin) end

if pos_functions[poscat] then pos_functions[poscat](args, data) end

local content = mw.title.new(PAGENAME):getContent

return require("Module:headword").full_headword(data) .. require("Module:utilities").format_categories(tracking_categories, lang)

end

local conjugation_types = { ["actor I"] = {"1st actor trigger", "Ilocano 1st actor focus verbs"}, -- um- or -um- ["actor II"] = { "2nd actor trigger", "Ilocano 2nd actor trigger verbs" }, -- ag- ["actor III"] = { "3rd actor trigger", "Ilocano 3rd actor trigger verbs" }, -- mang- ["actor IV"] = { "4th actor trigger", "Ilocano 4th actor trigger verbs" }, -- ma- ["actor potentive I"] = { "1st actor trigger potential mood", "Ilocano 1st actor trigger potential mood verbs" }, -- maka- ["actor potential II"] = { "2nd actor trigger potential mood", "Ilocano 2nd actor trigger potential mood verbs" }, -- makapag- ["actor causative I"] = { "2nd actor trigger potential mood", "Ilocano 1st actor trigger causative mood verbs" }, -- agpa- ["actor causative II"] = { "2nd actor trigger potential mood", "Ilocano 2nd actor trigger causative mood verbs" }, -- mangpa- ["object"] = { "object trigger", "Ilocano object trigger verbs" }, -- -en ["object potential"] = { "object trigger potential mood", "Ilocano object trigger potential mood verbs" }, -- ma- ["object causative"] = { "2nd actor trigger potential mood", "Ilocano object trigger causative mood verbs" }, -- ipai- ["comitative"] = { "comitative trigger", "Ilocano comitative trigger verbs" }, -- ka- ["comitative potential"] = { "comitative trigger potential mood", "Ilocano comitative trigger potential mood verbs" }, -- maka- ["comitative causative I"] = { "1st comitative trigger causative mood", "Ilocano 1st comitative trigger causative mood verbs" }, -- makapa- ["comitative causative II"] = { "2nd comitative trigger causative mood", "Ilocano 2nd comitative trigger causative mood verbs" }, -- makipa- ["locative"] = { "locative trigger", "Ilocano locative trigger verbs" },-- -an ["locative potential"] = { "locative trigger potential mood", "Ilocano locative trigger potential mood verbs" }, -- ma- -an ["locative causative"] = { "locative trigger causative mood", "Ilocano locative trigger causative mood verbs" }, -- pa- -an ["thematic"] = { "thematic trigger", "Ilocano thematic trigger verbs" }, -- i-   ["thematic potential"] = { "thematic trigger potential mood", "Ilocano thematic trigger potential mood verbs" }, -- mai- ["thematic causative"] = { "thematic trigger causative mood", "Ilocano thematic trigger causative mood verbs" }, -- ipa- ["benefactive"] = { "benefactive trigger", "Ilocano benefactive trigger verbs" }, -- i- -an ["benefactive potential"] = { "benefactive trigger potential mood", "Ilocano thematic trigger potential mood verbs" }, -- mai- -an ["benefactive causative"] = { "benefactive trigger causative mood", "Ilocano thematic trigger causative mood verbs" }, -- ipa- -an ["instrument"] = { "instrument trigger", "Ilocano instrument trigger verbs" }, -- pag- ["instrument potential"] = { "instrument trigger potential mood", "Ilocano instrument trigger potential mood verbs" }, -- mapag- ["instrument causative"] = { "1st instrument trigger causative mood", "Ilocano 1st instrument trigger causative mood verbs" }, -- pagpa- -an ["instrument causative II"] = { "2nd instrument trigger causative mood", "Ilocano 2nd instrument trigger causative mood verbs" }, -- panagpa-

}

pos_functions["verbs"] = function(args, data)

params = { [1] = {alias_of = 'head'}, [2] = {alias_of = 'perf'}, [3] = {alias_of = 'imperf'}, [4] = {alias_of = 'past_imperf'}, [5] = {alias_of = 'fut'}, head = {list = true}, head2= {}, head3= {}, perf = {list = true}, imperf = {list = true}, past_imperf = {list = true}, fut = {list = true}, rootword = {}, type = {}, type2 = {}, type3 = {}, b= {}, b2= {}, b3= {} }

local args = require("Module:parameters").process(args,params) data.heads = args.head data.id = args.id	local pattern = args.pattern args.perf.label = "perfective" args.imperf.label = "imperfective" args.past_imperf.label = "past imperfective" args.fut.label = "future"

args.perf.accel = {form = "perf"} args.imperf.accel = {form = "imperf"} args.past_imperf.accel = {form = "past|imperf"} args.fut.accel = {form = "fut"}

if #args.perf > 0 then table.insert(data.inflections, args.perf) end if #args.imperf > 0 then table.insert(data.inflections, args.imperf) end if #args.past_imperf > 0 then table.insert(data.inflections, args.past_imperf) end if #args.fut > 0 then table.insert(data.inflections, args.fut) end

--Tagging verb trigger local conjtype = args["type"] or nil if conjtype and conjugation_types[conjtype] then table.insert(data.inflections, {label = conjugation_types[conjtype][1]}) table.insert(data.categories, conjugation_types[conjtype][2]) end local conjtype = args["type2"] or nil if conjtype and conjugation_types[conjtype] then table.insert(data.inflections, {label = conjugation_types[conjtype][1]}) table.insert(data.categories, conjugation_types[conjtype][2]) end local conjtype = args["type3"] or nil if conjtype and conjugation_types[conjtype] then table.insert(data.inflections, {label = conjugation_types[conjtype][1]}) table.insert(data.categories, conjugation_types[conjtype][2]) end

end

pos_functions["adjectives"] = function(args, data)

--Mark adjective egrees params = { [1] = {alias_of = 'head'}, [2] = {alias_of = 'comp'}, [3] = {alias_of = 'mod'}, [4] = {alias_of = 'comp_sup'}, [5] = {alias_of = 'abs_sup'}, [6] = {alias_of = 'int'}, head = {list = true}, head2= {}, head3= {}, comp = {list = true}, mod = {list = true}, comp_sup = {list = true}, abs_sup = {list = true}, int = {list = true}, b= {}, b2= {}, b3= {} }	local args = require("Module:parameters").process(args,params) data.heads = args.head data.id = args.id	local pattern = args.pattern args.comp.label = "comparative" args.mod.label = "moderative" args.comp_sup.label = "comparative superlative" args.abs_sup.label = "absolutive superlative" args.int.label = "intensive"

args.comp.accel = {form = "comparative"} args.mod.accel = {form = "moderative"} args.comp_sup.accel = {form = "comparative|superlative"} args.abs_sup.accel = {form = "absolutive|superlative"} args.int.accel = {form = "intensive"}

if #args.comp > 0 then table.insert(data.inflections, args.comp) end if #args.mod > 0 then table.insert(data.inflections, args.mod) end if #args.comp_sup > 0 then table.insert(data.inflections, args.comp_sup) end if #args.abs_sup > 0 then table.insert(data.inflections, args.abs_sup) end if #args.int > 0 then table.insert(data.inflections, args.int) end end

pos_functions["nouns"] = function(args, data)

--Tagging plurals params = { [1] = {alias_of = 'head'}, head = {list = true}, head2= {}, head3= {}, plural = {list = true}, b= {}, b2= {}, b3= {} }	local args = require("Module:parameters").process(args,params) data.heads = args.head data.id = args.id	local pattern = args.pattern args.plural.label = "plural"

args.plural.accel = {form = "plural"}

if #args.plural > 0 then table.insert(data.inflections, args.plural) end end

return export