မဝ်ဂျူ:pam-headword

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

Deploys the Kapampangan headword-line templates.


local export = {}
local pos_functions = {}

local lang = require("Module:languages").getByCode("pam")
local PAGENAME = mw.title.getCurrentTitle().text
local script = require('Module:scripts').getByCode("Latn")

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 = {}}
	
	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

pos_functions["ကြိယာ"] = function(args, data)

    params = {
    	[1] = {alias_of = 'head'},
		[2] = {alias_of = 'perf'}, --Perfective. Use with affixed verbs only
		[3] = {alias_of = 'imp'},  --Imperfective. Use with affixed verbs only
		head = {list = true},
		head2= {},
		head3= {},
		perf = {list = true},
		imp = {list = true}
	}

	local args = require("Module:parameters").process(args,params)
	data.heads = args.head
	data.id = args.id
	local pattern = args.pattern
	
	args.perf.label = "ဗီုပြၚ်မက္ဍိုပ်ပေၚ်"
	args.imp.label = "ပါဲဗလေတ်ဟွံမာန်"

	args.perf.accel = {form = "ဗီုပြၚ်မက္ဍိုပ်ပေၚ်"}
	args.imp.accel = {form = "ပါဲဗလေတ်ဟွံမာန်"}

	if #args.perf > 0 then table.insert(data.inflections, args.inch) end
	if #args.imp > 0 then table.insert(data.inflections, args.imp) end

end

pos_functions["နာမဝိသေသန"] = function(args, data)

	    params = {
		[1] = {alias_of = 'head'},
		[2] = {alias_of = 'sup'},
		[3] = {alias_of = 'plural'}, -- See notes.
		head = {list = true},
		head2= {},
		head3= {},
		plural = {list = true}, -- Some adjectives only
	    sup = {list = true}

	}
	
	local args = require("Module:parameters").process(args,params)
	data.heads = args.head
	data.id = args.id
	local pattern = args.pattern
	
	args.sup.label = "သဒ္ဒာ"	
	args.plural.label = "ကိုန်ဗဟုဝစ်"

	args.sup.accel = {form = "သဒ္ဒာ"}
	args.plural.accel = {form = "ကိုန်ဗဟုဝစ်"}
	
	if #args.sup > 0 then table.insert(data.inflections, args.sup) end
	if #args.plural > 0 then table.insert(data.inflections, args.plural) end

end

pos_functions["နာမ်"] = function(args, data)

	    params = {
		[1] = {alias_of = 'head'},
		[2] = {alias_of = 'plural'}, -- Special plural cases only
		head = {list = true},
		head2= {},
		head3= {},
		plural = {list = true}
	}
	
	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