Module:mn-verb-form

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

This module implements the {{mn-verb form of}} and the {{mn-verb form name}} templates. To add more suffixes, edit Module:mn-verb-form/data.


local export = {}
local m_links = require("Module:links")
local m_utilities = require("Module:utilities")

local lang = require("Module:languages").getByCode("mn")

local data = mw.loadData("Module:mn-verb-form/data")

local function show_categories(data, lang, sort_key)
	local categories = {}
	
	for i, cat in ipairs(data.categories or {}) do
		table.insert(categories, lang:getCanonicalName() .. " " .. cat)
	end
	
	return m_utilities.format_categories(categories, lang, sort_key) 
end

function export.mn_verb_form(frame)
	local params = {
		 = {required = true, default = "suffix"},  --suffix
		 = {required = true, default = "term"},  --verb
		 = {},
		 = {alias_of = "gloss"},
		
		 = {},
		 = {},
		 = {alias_of = "gloss"},
		 = {},
		 = {type = "boolean"},
		 = {type = "boolean"},
		 = {},
		 = {},
		 = {},
	}	
	
	local args = require("Module:parameters").process(frame:getParent().args, params)

	local sc = (args and (require("Module:scripts").getByCode(args) or error("The script code \"" .. args .. "\" is not valid.")) or nil)
	
	local suffix = args
	local text = ""
	local alias = false
	
	if data.aliases] then
		alias = true
		suffix = data.aliases]
	end
	
	if data.suffix then
		local suffixinfo = {lang = lang, sc = sc, term = "-"..suffix, alt = alias and "-" .. args, id = "verb suffix"}
		local suffixlink = m_links.full_link(suffixinfo, "term", false)
		text = data.suffix.name .. " in " .. suffixlink .. " of"
	else 
		error("suffix not found")
	end
	
	local lemma_obj = {lang = lang, sc = sc, term = args, alt = args, id = args, gloss = args, tr = args}
	return require("Module:form of").format_form_of{text = text, lemmas = {lemma_obj}, lemma_face = "term"} .. (args.nocat and "" or show_categories(data.suffix, lang, args))
end

function export.mn_suffix_name(frame)
	local params = {
		 = {required = true, default = "suffix"},
	}
	local args = require("Module:parameters").process(frame:getParent().args, params)
	local suffix = args
	
	if data.aliases then
		suffix = data.aliases
	end
	
	if data.suffix then
		return data.suffix.name
	else 
		error("suffix not found")
	end
end
	
return export