Module:User:kc kennylau/yue-word
Jump to navigation
Jump to search
- The following documentation is located at Module:User:kc kennylau/yue-word/documentation. [edit] Categories were auto-generated by Module:documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • user page • user talk page • userspace
See also:
Duplicated Entries
- Module:zh/data/yue-word/023
- 學位,學堂,家用,山卡罅,
- Module:zh/data/yue-word/024
- 平價,後生,情願,
- Module:zh/data/yue-word/025
- 手感,採擷,收到,新地,
- Module:zh/data/yue-word/026
- 昂坪,
- Module:zh/data/yue-word/027
- 樂隊,正牌,水泡,沉魚落雁,洋行,
- Module:zh/data/yue-word/028
- 深造,清盤,炒魷魚,烏龍,
- Module:zh/data/yue-word/029
- 生性,
- Module:zh/data/yue-word/030
- 番石榴,白話,省城,
- Module:zh/data/yue-word/031
- 祖廟,禁做,禁用,禁色,禮輕人意重,粉刷,粉絲,
- Module:zh/data/yue-word/033
- 腳架,落袋,
- Module:zh/data/yue-word/034
- 行經,
- Module:zh/data/yue-word/035
- 言者無罪,認真,貼士,
- Module:zh/data/yue-word/036
- 趑車轉,
- Module:zh/data/yue-word/037
- 鄉下,銅鑼灣,鋪頭,
- Module:zh/data/yue-word/038
- 開盤,靚仔,面試,頭頭,
- Module:zh/data/yue-word/039
- 風水佬呃你十年八年,風爐,養兒一百歲,長憂九十九,馬蹄,騷擾,髮夾,魚丸,鮑魚,鯁唔落,
- Module:zh/data/yue-word/040
- 鴛鴦,鷸蚌相爭,麻雀,
- Module:zh/data/yue-word/062
- 口,
Mismatch of number of characters
- Module:zh/data/yue-word/019
- 不能事二主,上梁不正下梁歪,一言既出駟馬難追,主婦手,中下層,中央軍事委員會,三兩,
- Module:zh/data/yue-word/020
- 以訛傳訛,仄聲,儒林外史,傳輸,利索,倒屎塔,免佣,冇咁大個頭唔好戴咁大頂帽,其樂無窮,兵敗如山倒,人道主義,免職,乘船,作勢,兒化韻,乘虛而入,保管員,
- Module:zh/data/yue-word/021
- 半分,十個茶壺九個蓋,唔食廣東米,啐唾沫,司馬昭之心,反鬥,剝皮牛,嗾使,嗰日,啄食,喐嚟喐去,唔識佢,嗲嗲吊,勞逸結合,咖央醬,呢吓,及時行樂,可尊敬,只許成功不許失敗,合頁,
- Module:zh/data/yue-word/022
- 國立歷史博物館,大飲大食,夫復何求,垃圾帖子,夾硬迫入去,夾硬要佢去,嘴𠴕𠴕,奀瘦,天然白虎湯,
- Module:zh/data/yue-word/023
- 射影變換,宮保雞丁,安遠縣,字正腔圓,對上,屌你老母閪,屌你老母臭閪,尖沙嘴,小打小鬧,射影幾何學,射影幾何,密西西比州,
- Module:zh/data/yue-word/024
- 恩恤金,幫理不幫親,平方哩,年尾雙糧,平仄,
- Module:zh/data/yue-word/025
- 披覽群書,打橫放,打字員,拆樓,打倒掟放,成晚,施放,撞船,我屋企側近有樖好大嘅柳樹,手感,撒手人寰,擬聲,戙起床版,打橫寫,
- Module:zh/data/yue-word/026
- 暗病,有請,旗鑑店,東鐵支線,極力子,有興趣,有其父必有其子,
- Module:zh/data/yue-word/027
- 款廂型車,正話,殺手鐧,海岸護衛隊,死啦,此際,殿堂,毛織運動衫,橫行霸道,
- Module:zh/data/yue-word/028
- 烘底,深造,為人正直,滑蛋,游繩而下,焦媛,無記名,
- Module:zh/data/yue-word/029
- 男性尊稱,爆肽,爭拗,熨燙,
- Module:zh/data/yue-word/030
- 直笛,石叻,當權,異想世界,百尺竿頭,真相露,畫廊,知無不言,異性性接觸,石屎樓,異樣,番薯糖,癩蛤蟆想食天鵝肉,
- Module:zh/data/yue-word/031
- 箭在弦上,笸籮,細個嗰陣時,科文,福無雙至,
- Module:zh/data/yue-word/032
- 繑口,聽晚,肉刺,
- Module:zh/data/yue-word/033
- 萬大事有我,舂個頭埋去,
- Module:zh/data/yue-word/034
- 袒胸露臂,表示尊敬的,藝員,蘇州過後冇艇搭,蠍子,處世原則,
- Module:zh/data/yue-word/035
- 褦襶,販賣部,見飯,製動,詞性,話是話,豆丁,
- Module:zh/data/yue-word/036
- 返嚟,近在咫尺,連環,起上嚟,跌落地都要楋翻揸沙,那麽,退下,賣萌,賓士,轉圈,
- Module:zh/data/yue-word/037
- 金融市場,鐘意,重活,鋤強扶弱,鋥亮,重塑,
- Module:zh/data/yue-word/038
- 開罐頭,霧氣,頑劣份子,靜靜地,開跑閘,順風駛𢃇,隨機應變,
- Module:zh/data/yue-word/039
- 騎呢,體系化,高麗,香港互聯網註冊管理有限公司,香港大學大學堂,鬥細佬哥,高加索山,骨質疏鬆症,香港日本人俱樂部,
- Module:zh/data/yue-word/040
- 鴨絨,鼻腍,
--local Han_pattern = "[" .. require("Module:scripts").getByCode("Hani"):getCharacters() .. "]"
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("[^\n]+") 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 .. '* [[' .. name .. ']]\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 .. '* [[' .. name .. ']]\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[ch] and not ch_data[ch]: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 .. '* [[' .. name .. ']]\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,["in"]=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+)[1-6](%-?[12]?)$")
if not s or #v == 1 then return false end
local i,f = s:match("^([bpmfdtnlgknhzcsjw][gw]?)([aeiouy]+[mnptk]?g?)$")
if i and initials[i] and finals[f] then return true end
if finals[s] 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 .. '* [[' .. name .. ']]\n**' .. buffer .. '\n'
end
end
end
return res
end,
}