မဝ်ဂျူ:urj-fin-headword

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

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

local export = {}

local lang = require("Module:languages").getByCode("urj-fin-pro")

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	local args = frame:getParent().args
	SUBPAGENAME = mw.title.getCurrentTitle().subpageText
	
	local head = args["head"]; if head == "" then head = nil end
	
	-- The part of speech. This is also the name of the category that
	-- entries go in. However, the two are separate (the "cat" parameter)
	-- because you sometimes want something to behave as an adjective without
	-- putting it in the adjectives category.
	local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
	local cat = args["cat"]; if cat == "" then cat = nil end
	
	local inflections = nil
	local categories = {}
	
	if poscat == "ကြိယာ" then
		local stem = args[1]
		
		if stem then
			inflections = {{ label = "တံမအရေဝ်", "*" .. stem .. "-" }}
			if args["တံမအရေဝ်၂"] then
				table.insert(inflections[1], "*" .. args["stem2"] .. "-")
			end
		else

		end
	end
	
	local data = {lang = lang, pos_category = cat or poscat, categories = categories, heads = {head}, inflections = inflections}
	
	return require("Module:headword").full_headword(data)
end

return export