Module:User:Victar/sandbox

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

Lua error at line 14: attempt to call field 'getFull' (a nil value)


local export = {}

local m_languages = require("Module:languages")

function export.sandbox()
	local term = "lait"
	local lang = "fro"
	local id = "ugly"
	
	lang = m_languages.getByCode(lang)
		or require("Module:etymology languages").getByCode(lang)
		or m_languages.err(lang, 1)
		
	local entryLang = require("Module:etymology").getFull(lang)
	
	local page = mw.title.new(require("Module:links").getLinkPage(term, lang))
	local content = page:getContent()
	
	if not content then
		return ""
	end
	
	local _, index = mw.ustring.find(content, "\n==" .. lang:getCanonicalName() .. "==", nil, true)
	if not index then
		_, index = mw.ustring.find(content, "^==" .. require("Module:utilities").pattern_escape(lang:getCanonicalName()) .. "==", nil, false)
	end
	if not index then
		error("Language not found: " .. lang:getCanonicalName() .. ".")
	end
	_, next_lang = mw.ustring.find(content, "\n==+==", index, false)
	_, index = mw.ustring.find(content, "\n(=====?)Descendants%1", index, false)
	if (not index) or (next_lang and next_lang < index) then
		error("Descendants not found")
	end
	
	index = "^.*(\n==" .. lang:getCanonicalName() .. ".*)\n==.*"
	content = mw.ustring.match(content, index)
	
	content = mw.ustring.gsub(content, "----", "") -- remove devider
	
	local content = require("Module:string").matchToArray(content, "(\n=+*=+.-)\n=+")
	
	--index = "^.*(\n=+Descendants=+\n*).*"
	--content = mw.ustring.gsub(content, index, "%1") -- get first list of descendants
	
	-- content = mw.ustring.gsub( content, "^.*{{senseid|" .. lang:getCode() .. "|" .. id .. "}}(.*)", "%1")
	
	return content
	
end

return export