Module:User:Theknightwho/etymology/templates/internal

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


-- For internal use only with ] and its submodules.

local export = {}

function export.fetch_lang(lang, param)
	return require("Module:User:Theknightwho/languages").getByCode(lang, param)
end


function export.fetch_source(code, param, disallow_family)
	return require("Module:User:Theknightwho/languages").getByCode(code, param, true, not disallow_family)
end


local function fetch_sources(codes, param, disallow_family)
	local m_languages = require("Module:User:Theknightwho/languages")
	codes = mw.text.split(codes, "%s*,%s*")
	for i, code in ipairs(codes) do
		codes = m_languages.getByCode(code, param, true, not disallow_family)
	end
	return codes
end


function export.fetch_source_or_sources(source, param, disallow_family)
	local sources
	if source:find(",") then
		sources = fetch_sources(source, param, disallow_family)
		source = sources
	else
		source = export.fetch_source(source, param, disallow_family)
	end
	return source, sources
end


function export.fetch_script(sc, param)
	return require("Module:User:Theknightwho/scripts").getByCode(sc, param)
end


function export.parse_2_lang_args(frame, has_text, no_family)
	local params = {
		 = true,
		 = true,
		 = false,
		
		 = {aliases = {4}},
		 = false,
		 = false,
		 = false,
		 = false,
		 = {aliases = {5, "gloss"}},
		 = false,
		 = false,
		 = false,
		 = false,

		 = false,
		 = false,
		 = false,
	}

	if has_text then
		params = false
		params = false
	end

	local args = require("Module:parameters/lite").process(frame:getParent().args, params)
	local yesno = require("Module:yesno")

	args = require("Module:parameters/lite/list")(frame:getParent().args, "g")
	args = yesno(args)
	if has_text then
		args = yesno(args)
		args = yesno(args)
	end
	
	local lang = export.fetch_lang(args, 1)
	local source, sources = export.fetch_source_or_sources(args, 2, no_family)
	local sc = export.fetch_script(args, "sc")

	return args, lang, {
		lang = source,
		sc = sc,
		term = args,
		alt = args,
		id = args,
		genders = args,
		tr = args,
		ts = args,
		gloss = args,
		pos = args,
		lit = args
	}, sources
end

return export