Module:User:kc kennylau/yue-word

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

See also:


--local Han_pattern = ""
local Han_pattern = ""

return {
check_duplicated = function(frame)
	local res = ''
	for i=0,170 do
		local name = ("Module:zh/data/yue-word/%03d"):format(i)
		local page = mw.title.new(name):getContent()
		if page then
			local buffer = ''
			for line in page:gmatch("+") do
				word, prons = line:match('\t%+)"%] = "(.+)",')
				if word and word == prev_word then
					buffer = buffer .. word .. ','
				end
				prev_word = word
			end
			if buffer ~= '' then
				res = res .. '* ]\n**' .. buffer .. '\n'
			end
		end
	end
	return res
end,
check_mismatch = function(frame)
	local res = ''
	for i=0,170 do
		local name = ("Module:zh/data/yue-word/%03d"):format(i)
		local success, data = pcall(mw.loadData,name)
		if success then
			local buffer = ''
			for word, prons in pairs(data) do
				test, word_len = mw.ustring.gsub(word,Han_pattern,"")
				if test == "" then
					local pass = true
					for pron in prons:gmatch("+") do
						local pron_len = pron:gsub("+",""):len() + 1
						if word_len ~= pron_len then
							pass = false
							break
						end
					end
					if not pass then
						buffer = buffer .. word .. ','
					end
				end
			end
			if buffer ~= '' then
				res = res .. '* ]\n**' .. buffer .. '\n'
			end
		end
	end
	return res
end,
check_consistency = function(frame)
	local no_tone = frame.args.no_tone
	local res = ''
	local ch_data = mw.loadData("Module:zh/data/Jyutping character")
	for i=-1,170 do
		local name = ("Module:zh/data/yue-word/%03d"):format(i)
		if i == -1 then name = "Module:zh/data/yue-pron" end
		local success, data = pcall(mw.loadData,name)
		if i == -1 then data = data.jyutping end
		if success then
			local buffer = ''
			for word, prons in pairs(data) do
				local pass = true
				local ch = nil
				if mw.ustring.find(word,"^"..Han_pattern.."+$") then
					for pron in prons:gmatch("+") do
						local j=1
						for ch_pron in pron:gmatch("+") do
							ch_pron = ch_pron:gsub("%-%d$","")
							if no_tone then ch_pron = ch_pron:gsub("%d$","") end
							ch = mw.ustring.sub(word,j)
							if ch_data and not ch_data:find(ch_pron,1,true) then
								pass = false
								break
							end
							j = j + 1
						end
						if not pass then break end
					end
				end
				if not pass then buffer = buffer .. word .. "(" .. ch .. ")," end
			end
			if buffer ~= '' then
				res = res .. '* ]\n**' .. buffer .. '\n'
			end
		end
	end
	return res
end,
check_jyutping = function(frame)
	local initials = {
		b=1,p=1,m=1,f=1,d=1,t=1,n=1,l=1,
		g=1,k=1,ng=1,h=1,gw=1,kw=1,
		z=1,c=1,s=1,j=1,w=1,
	}
	local finals = {
		aa=1,aai=1,aau=1,aam=1,aan=1,aang=1,aap=1,aat=1,aak=1,
		a=1,ai=1,au=1,am=1,an=1,ang=1,ap=1,at=1,ak=1,
		e=1,ei=1,eu=1,em=1,eng=1,ep=1,ek=1,
		i=1,iu=1,im=1,=1,ing=1,ip=1,it=1,ik=1,
		o=1,oi=1,ou=1,on=1,ong=1,ot=1,ok=1,
		u=1,ui=1,un=1,ung=1,ut=1,uk=1,
		eoi=1,eon=1,eot=1,
		oe=1,oeng=1,oet=1,oek=1,
		yu=1,yun=1,yut=1
	}
	local function checker(syl)
		local s,v = syl:match("^(%l+)(%-??)$")
		if not s or #v == 1 then return false end
		local i,f = s:match("^(?)(+?g?)$")
		if i and initials and finals then return true end
		if finals or s == "m" or s == "ng" then return true end
		return false
	end
	local res = ''
	for i=0,170 do
		local name = ("Module:zh/data/yue-word/%03d"):format(i)
		local success, data = pcall(mw.loadData,name)
		if success then
			local buffer = ''
			for word, prons in pairs(data) do
				prons = prons:gsub(","," "):gsub("…"," ")
				for syl in prons:gmatch("+") do
					if not checker(syl) then
						buffer = buffer .. word .. "(" .. syl .. "),"
						break
					end
				end
			end
			if buffer ~= '' then
				res = res .. '* ]\n**' .. buffer .. '\n'
			end
		end
	end
	return res
end,
}