Module:ne-utilities

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


local export = {}

local m_links = require("Module:links")
local m_translit = require("Module:ne-translit")

function export.usex(frame)
	local args = frame:getParent().args
	local pagename = mw.title.getCurrentTitle().text
	local text = {}
	local example = args or error("Example has not been specified. Please pass parameter 1 to the module invocation.")
	local translation = args or ""

	if (not mw.ustring.match(example, "'''")) and mw.ustring.match(example, pagename) then
		example = mw.ustring.gsub(example, pagename, "'''" .. pagename .. "'''")
	end	
	local translit = m_translit.tr(m_links.remove_links(example), "ne", "Deva")
	example = mw.ustring.gsub(example, "", "")

	table.insert(text, ('<span lang="ne" class="Deva">%s</span>'):format(example))
	if mw.ustring.match(example, "") then
		table.insert(text, "<dl><dd>''" .. translit .. "''</dd><dd>" .. translation .. "</dd></dl>")
	else
		table.insert(text, "&nbsp; ―&nbsp; ''" .. translit .. "''&nbsp; ―&nbsp; " .. translation)
	end
	return table.concat(text)
end

function export.link(frame)
	if type(frame) == "table" then
		args = frame:getParent().args
		text = args
		def = args or false
		vert = args or false
	else
		text = frame
	end
	text = ('<span lang="ne" class="Deva">", "")) .. 
		('%s]]</span>'):format(mw.ustring.gsub(text, "", "")) ..
		(vert and "<div style=\"line-height:1pt; font-size:90%; color:#888\"><br>" or " (") .. m_translit.tr(text, "ne", "Deva") .. 
		(def and ', “' .. def .. '”' or "") .. (vert and "</div>" or ")")
	return text
end

return export