Module:zh/data/yue-word

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

function export.get_all()
	local ret = {}
	for i=0,196 do --196 is the limit
		success, data = pcall(mw.loadData,('Module:zh/data/yue-word/%03d'):format(i))
		if success then
			for key,val in pairs(data) do
				ret = {}
				val = mw.ustring.gsub(val,", ",",")
				for pron in mw.text.gsplit(val,",",true) do
					pron = mw.ustring.gsub(pron,",",", ")
					table.insert(ret,pron)
				end
			end
		end
	end
	return ret
end

function export.get_all_reverse()
	local ret = {}
	for i=0,196 do --196 is the limit
		success, data = pcall(mw.loadData,('Module:zh/data/Jyutping_word/%03d'):format(i))
		if success then
			for key,val in pairs(data) do
				val = mw.ustring.gsub(val,", ",",")
				for pron in mw.text.gsplit(val,",",true) do
					pron = mw.ustring.gsub(pron,",",", ")
					if ret then
						table.insert(ret,key)
					else
						ret = {key}
					end
				end
			end
		end
	end
	return ret
end

function export.get_homophones()
	local ret = export.get_all_reverse()
	for key,val in pairs(ret) do
		if #val == 1 then
			ret = nil
		end
	end
	return ret
end

return export