မဝ်ဂျူ:mdh-headword

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

This module deploys all Maguindanao headword-line templates.


local export = {}
local pos_functions = {}

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

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 jawi = {label = "ခ္ဍံက်လိက်ဂျဝဳ"}
	local sc_Arab = require("Module:scripts").getByCode("Arab")
	if args["j"] then table.insert(jawi, { term = args["j"], sc = sc_Arab }) end
	if args["j2"] then table.insert(jawi, { term = args["j2"], sc = sc_Arab }) end
	if args["j3"] then table.insert(jawi, { term = args["j3"], sc = sc_Arab }) end
    if #jawi > 0 then table.insert(data.inflections, jawi) end

    local latin = {label = "ခ္ဍံက်လိက်လပ်တေန်"}
    local sc_Latn = require("Module:scripts").getByCode("Latn")
    if args["r"] then table.insert(latin, {term = args["r"], sc = sc_Latn}) end
    if args["r2"] then table.insert(latin, {term = args["r2"], sc = sc_Latn}) end
    if args["r3"] then table.insert(latin, {term = args["r3"], sc = sc_Latn}) end
    if #latin > 0 then table.insert(data.inflections, latin) end

    if script:getCode() == "Arab" 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

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

	    params = {
		[1] = {alias_of = 'head'},
		[2] = {alias_of = 'comp_sup'},
		[3] = {alias_of = 'abs_sup'},
		[4] = {alias_of = 'plural'}, -- See notes.
		head = {list = true},
		head2= {},
		head3= {},
		plural = {list = true}, -- Some adjectives only
	    comp_sup = {list = true},
		abs_sup = {list = true},
		j= {},
		j2= {},
		j3= {}
	}
	
	local args = require("Module:parameters").process(args,params)
	data.heads = args.head
	data.id = args.id
	local pattern = args.pattern
	
	args.comp_sup.label = "comp_sup"
	args.abs_sup.label = "abs_sup"	
	args.plural.label = "ကိုန်ဗဟုဝစ်"

	args.comp_sup.accel = {form = "ပတုပ်ရံၚ်|သဒ္ဒာ"}
	args.abs_sup.accel = {form = "မသ္ဍိုက်ပေၚ်တဴ|သဒ္ဒာ"}
	args.plural.accel = {form = "ကိုန်ဗဟုဝစ်"}
	
	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.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},
		j= {},
		j2= {},
		j3= {}
	}
	
	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