မဝ်ဂျူ:etymology/templates/cognate

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

Documentation for this module may be created at မဝ်ဂျူ:etymology/templates/cognate/doc

local export = {}

local m_internal = require("Module:etymology/templates/internal")

function export.cognate(frame)
	local args = frame:getParent().args
	
	if args.gloss then
		require("Module:debug/track")("cognate/gloss param")
	end
	
	local params = {
		[1] = {required = true, default = "und"},
		[2] = {},
		[3] = {alias_of = "alt"},
		[4] = {alias_of = "t"},
		
		["alt"] = {},
		["g"] = {list = true},
		["id"] = {},
		["lit"] = {},
		["pos"] = {},
		["t"] = {},
		["gloss"] = {alias_of = "t"},
		["tr"] = {},
		["ts"] = {},
		["sc"] = {},
		
		["sort"] = {},
		["conj"] = {},
	}
	
	args = require("Module:parameters").process(args, params)
	
	local source, sources = m_internal.fetch_source_or_sources(args[1], 1)
	local sc = m_internal.fetch_script(args["sc"], "sc")

	local terminfo = {
		lang = source,
		sc = sc,
		term = args[2],
		alt = args["alt"],
		id = args["id"],
		genders = args["g"],
		tr = args["tr"],
		ts = args["ts"],
		gloss = args["t"],
		pos = args["pos"],
		lit = args["lit"]
	}

	if sources then
		return require("Module:etymology/multi").format_multi_cognate(sources, terminfo, args.sort, args.conj)
	else
		return require("Module:etymology").format_cognate(terminfo, args.sort)
	end
end


function export.noncognate(frame)
	return export.cognate(frame)
end

return export