Module:User:MewBot

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

This is a support module used to run certain functions of the bot User:MewBot.


local export = {}

function export.getLanguageData(frame)
	local iparams = {
		 = {type = "number"},
		 = {type = "number"},
		 = {type = "boolean"},
	}
	local iargs = require("Module:parameters").process(frame.args, iparams)
	local m_languages = require("Module:languages")
	local ret = {}

	local index = 0
	for code, data in pairs(require("Module:languages/data/all")) do
		index = index + 1
		if (not iargs.first or index >= iargs.first) and (not iargs.last or index <= iargs.last) then
			local lang = m_languages.makeObject(code, data, true):toJSON("returnTable")
			-- Remove blank aliases/varieties/otherNames/ancestors
			for _, to_remove in ipairs { "aliases", "varieties", "otherNames", "ancestors"} do
				if lang and not lang then
					lang = nil
				end
			end
			-- For full languages, "full" is always or almost always the same as the lang code; if so, remove it.
			if lang.full == lang.code then
				lang.full = nil
			end
			-- For full languages, "type" should always contain "language" and "full"; remove them.
			local hacked_types = {}
			for _, typ in ipairs(lang.type) do
				if typ ~= "language" and typ ~= "full" then
					table.insert(hacked_types, typ)
				end
			end
			lang.type = hacked_types
			table.insert(ret, require("Module:JSON").toJSON(lang, {compress = true}))
		end
	end

	local retval = ""
	if iargs.getsize then
		return tostring(mw.ustring.len(retval))
	else
		return retval
	end
end

function export.getFamilyData(frame)
	local m_families = require("Module:families")
	local ret = {}
	
	for code, data in pairs(require("Module:families/data")) do
		local fam = m_families.makeObject(code, data, true)
		table.insert(ret, fam:toJSON())
	end
	
	return ""
end

function export.getScriptData(frame)
	local m_scripts = require("Module:scripts")
	local ret = {}
	
	for code, data in pairs(require("Module:scripts/data")) do
		local sc = m_scripts.makeObject(code, data, true)
		table.insert(ret, sc:toJSON())
	end
	
	return ""
end

function export.getEtymLanguageData(frame)
	local m_languages = require("Module:languages")
	local ret = {}
	
	for code, data in pairs(require("Module:etymology languages/data")) do
		local etymlang = m_languages.makeObject(code, data, true, "dont canonicalize aliases")
		table.insert(ret, etymlang:toJSON())
	end
	
	return ""
end

return export