Module:User:InscrutableTed/zh-list-zs

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


local export = {}
local m_phonetic = mw.loadData("Module:zh-glyph/phonetic")


function m_och(char) 
	local success, result = pcall(mw.loadData, "Module:zh/data/och-pron-ZS/" .. char);
	return (success and result) or ""
end

function export.show(frame)
	local glyphs = {}
	for _, values in pairs(m_phonetic) do 
		for value in mw.text.gsplit(values, "") do
			table.insert(glyphs, value)
		end
	end
	
	table.sort(glyphs);
	
	local result = { }

	local pagesize = 500;
	local numitems = #glyphs;
	local numpages = math.ceil(numitems / pagesize);

	local n = tonumber(mw.ustring.match(mw.title.getCurrentTitle().text, "%d+$"));
	if n == 0 or not n then n = 1 end

	table.insert(result, "Page " .. n .. " of " .. numpages);
	
	local other = "";
	if n == 2 then
		other = other .. "← ]"
	elseif n > 1 then
		other = other .. "← ]"
	end
	
	if n < numpages then
		other = other .. "→ ]"
	end
	
	table.insert(result, "\n'''''<center>" .. other .. "</center>'''''\n")
	table.insert(result, "<pre>\n");
	for k, glyph in ipairs(glyphs) do
		if k > (n - 1) * pagesize and k <= n * pagesize then
			local och = m_och(glyph)
			table.insert(result, glyph .. "," .. och .. "\n")
		end
	end
	table.insert(result, "</pre>\n");
	table.insert(result, "\n'''''<center>" .. other .. "</center>'''''")
	return table.concat(result)
end

return export