Module:root

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

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local export = {}

local force_cat = false -- for debugging

function export.categorize(lang, source, roots, ids, sort_key)
	local categories = {}
	
	if lang:getCode() ~= source:getCode() then
		table.insert(categories,
			lang:getFullName() .. " terms derived from " .. source:getCanonicalName())
	end
	
	for index, root in ipairs(roots) do
		if lang:getCode() == source:getCode() then
			table.insert(categories,
				lang:getFullName() .. " terms belonging to the root " .. root .. (ids and " (" .. ids .. ")" or ""))
		else
			table.insert(categories,
				lang:getFullName() .. " terms derived from the " .. source:getCanonicalName() ..
						" root " .. root .. (ids and " (" .. ids .. ")" or ""))
		end
	end
	
	return require("Module:utilities").format_categories(categories, lang, sort_key, nil, force_cat)
end

function export.show(frame)
	local params = {
		 = { required = true, type = "language" },
		 = { required = true, type = "language" },
		 = { required = true, list = true },
		 = { list = true, allow_holes = true },
		 = {},
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	return export.categorize(args, args, args, args.id, args.sort)
end

return export