မဝ်ဂျူ:ilo-headword

နူ ဝိက်ရှေန်နရဳ

Documentation for this module may be created at မဝ်ဂျူ:ilo-headword/doc

local export = {}
local pos_functions = {}

local lang = require("Module:languages").getByCode("ilo")
local PAGENAME = mw.title.getCurrentTitle().text
local script = require('Module:scripts').getByCode("Latn")
local script = require('Module:scripts').getByCode("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 = {}}
	
	--Baybayin
	local baybayin = {label = "ခ္ဍံက်လိက်ၜေအ်ဗေန်"}
	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
	
    --Categorize words in Baybayin
    if script:getCode() == "Tglg" then
       
    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", "ကြိယာတဂန်ကောန်ဍေၚ်မနုက်ကဵု၁နကဵုဝေါဟာအဳလဝ်ကာနဝ်ဂမၠိုၚ်"}, -- um- or -um-
	["actor II"] = { "2nd actor trigger", "ကြိယာတဂန်ကောန်ဍေၚ်မနုက်ကဵု၂နကဵုဝေါဟာအဳလဝ်ကာနဝ်ဂမၠိုၚ်" }, -- ag-
	["actor III"] = { "3rd actor trigger", "ကြိယာတဂန်ကောန်ဍေၚ်မနုက်ကဵု၃နကဵုဝေါဟာအဳလဝ်ကာနဝ်ဂမၠိုၚ်" }, -- mang-
	["actor IV"] = { "4th actor trigger", "ကြိယာတဂန်ကောန်ဍေၚ်မနုက်ကဵု၄နကဵုဝေါဟာအဳလဝ်ကာနဝ်ဂမၠိုၚ်" }, -- 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["ကြိယာ"] = 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 = "ဗီုပြၚ်မက္ဍိုပ်ပေၚ်"
	args.imperf.label = "ပါဲဗလေတ်ဟွံမာန်"
	args.past_imperf.label = "ပါဲဗလေတ်ဟွံမာန်နကဵုအတိတ်"
	args.fut.label = "အနာဂတ်"

	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["နာမဝိသေသန"] = 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 = "ပတုပ်ရံၚ်"
	args.mod.label = "မခိုဟ်ဆၜိုတ်"
	args.comp_sup.label = "ပတုပ်ရံၚ်သဒ္ဒာ"
	args.abs_sup.label = "သဒ္ဒာမက္ဍိုပ်ပေၚ်"
	args.int.label = "မသ္ကာတ်မြဟ်"

	args.comp.accel = {form = "ပတုပ်ရံၚ်"}
	args.mod.accel = {form = "မခိုဟ်ဆၜိုတ်"}
	args.comp_sup.accel = {form = "comparative|superlative"}
	args.abs_sup.accel = {form = "absolutive|superlative"}
	args.int.accel = {form = "မသ္ကာတ်မြဟ်"}

	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["နာမ်"] = 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 = "ကိုန်ဗဟုဝစ်"

	args.plural.accel = {form = "ကိုန်ဗဟုဝစ်"}

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

return export