Module:User:Benwing2/etymology/templates/cognate

Hello, you have come here looking for the meaning of the word Module:User:Benwing2/etymology/templates/cognate. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:Benwing2/etymology/templates/cognate, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:Benwing2/etymology/templates/cognate in singular and plural. Everything you need to know about the word Module:User:Benwing2/etymology/templates/cognate you have here. The definition of the word Module:User:Benwing2/etymology/templates/cognate will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:Benwing2/etymology/templates/cognate, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This is a private module sandbox of Benwing2, for their own experimentation. Items in this module may be added and removed at Benwing2's discretion; do not rely on this module's stability.


local export = {}

local etymology_module = "Module:User:Benwing2/etymology"
local etymology_multi_module = "Module:User:Benwing2/etymology/multi"

local process_params = require("Module:parameters").process

do
	local function get_args(parent_args)
		local alias_of_t = {alias_of = "t"}
		local plain = {}
		return process_params(parent_args, {
			 = {
				required = true,
				sublist = true,
				type = "language",
				family = true,
				default = "und"
			},
			 = plain,
			 = {alias_of = "alt"},
			 = alias_of_t,
			 = plain,
			 = plain,
			 = {list = true},
			 = alias_of_t,
			 = plain,
			 = plain,
			 = plain,
			 = {type = "script"},
			 = plain,
			 = plain,
			 = plain,
			 = plain,
		})
	end
	
	function export.cognate(frame)
		local parent_args = frame:getParent().args
		
		if parent_args.gloss then
			require("Module:debug/track")("cognate/gloss param")
		end
		
		local args = get_args(parent_args)
		local sources = args
	
		local terminfo = {
			lang = sources,
			sc = args,
			term = args,
			alt = args,
			id = args,
			genders = args,
			tr = args,
			ts = args,
			gloss = args,
			pos = args,
			lit = args
		}
	
		if #sources > 1 then
			return require(etymology_multi_module).format_multi_cognate {
				sources = sources,
				terminfo = terminfo,
				sort_key = args.sort,
				conj = args.conj,
			}
		end
		return require(etymology_module).format_cognate {
			terminfo = terminfo,
			sort_key = args.sort,
		}
	end
end

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

return export