Module:User:Wyang/yue-check-pron

local export = {} local md = require("Module:User:Wyang/yue-monosyllabic").data local pd = require("Module:User:Wyang/yue-polysyllabic").data

local function format_han(text, nolink) return ' ' .. (nolink and text or  .. text .. ) .. ' ' end

function export.make(data) local result = {} for word, readings in pairs(pd) do		i = 0 reading = mw.text.split(readings, " ") for ch in mw.text.gsplit(word, "") do			if not mw.ustring.find(ch, "[…，·%-]") then i = i + 1 if not reading[i] then table.insert(result, "* unequal # of characters and Jyutping syllables in " ..						format_han(word) .. " (''" .. readings .. "'')")				else local ref = md[ch] if ref and not ref[reading[i]] then local temp = {} for chr, _ in pairs(ref) do							table.insert(temp, chr) end table.insert(result, "* " .. format_han(ch, true) .. " (''" .. reading[i] .. ") in " .. 							format_han(word) .. " (" .. readings .. ") not found in " .. 							format_han(ch) .. " (" .. table.concat(temp, ", ") .. "'')")					end end end end end table.sort(result) return table.concat(result, "\n") end

return export