မဝ်ဂျူ:new-headword

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

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

local export = {}
local pos_functions = {}
local links = require('Module:links')
local labels = require('Module:labels')
local m_scripts = require("Module:scripts")

local lang = require("Module:languages").getByCode("new")
local script = require("Module:scripts").getByCode("Deva")
local PAGENAME = mw.title.getCurrentTitle().text

local Deva_Newa_translit = require('Module:Deva-Newa-translit')
local Newa_Deva_translit = require('Module:Newa-Deva-translit')
local function track(page)
	require("Module:debug").track("new-headword/" .. page)
end
function export.show(frame)
	local args = require('Module:parameters').process(frame:getParent().args,{
		['g'] = {default = '?'},
		['head'] = {},
        ["tr"] = {list = true, allow_holes = true},
	})
	local poscat = frame.args[1] or error('Part of speech has not been specified. Please pass parameter 1 to the module invocation.')
	
	local data = {lang = lang, sc = current_script, pos_category = poscat, sccat = true, categories = {}, heads = {args['head'] or PAGENAME}, genders = {}, translits = args["tr"],  inflections = {}}
	
	if poscat == 'နာမ်' or poscat == 'နာမ်မကိတ်ညဳ' then
		if args['g'] == 'm' or args['g'] == 'f' then
			table.insert(data.genders, args['g'])
		else
			table.insert(data.genders, '?')
		end
	end
		if #data.translits > 0 then
		track("manual-translit/" .. poscat)
	end
	if current_script:getCode() == 'Deva' then
		table.insert(data.inflections, {label = 'ခ္ဍံက်လိက်နဳဝါ', Deva_Newa_translit.tr(head or PAGENAME, lang, m_scripts.getByCode('Deva'))})
	end
	if current_script:getCode() == 'Newa' then
		table.insert(data.inflections, {label = 'ခ္ဍံက်လိက်ဒေဝ', Newa_Deva_translit.tr(head or PAGENAME, lang, m_scripts.getByCode('Newa'))})
	end
	return require('Module:headword').full_headword(data)
end

return export