可以通过正则方法,把手动处理的 拼音进行查看,以规避错误,比如拼音中表示声调的数字,其位置不能错:
- Sub f()
- Dim PYSJ(1 To 32)
- PYSJ(1) = "kao3/qiao3/yu2,shang4/shang3,xia4,han3/chang3,mian3,chou3,shi4,diu1,qiu1,liang3,you3,bing4/bing1,jiu1,ji3,jie4,guan4/kuang4,chan3,zhuo2,ba1,ha/jing3,fu2,yi2,yi4,wu3/shime,jiu3,yi1/ho,yin2,hu3,xia4/he4/cheng2/sheng4,yi3,yi3/monzmen,gai4,jiu1,xia4/hal,hol/fumoto,dou3/dul,shi3/zhong1,nong1,jia1/gal,ju4/geol,shi2/dol,mao3/myol,hu1/hol,cɑlo/cal,xue2,yan3,fu3/bol/pol,sha1/dal,na2,qian2/gan1/gan4,suo3/sol,yu2/neul/eul,zhu4/jul,zhe3/jal,luan4,gui1/jun1/qiū,qian2/gan1/gan4,luan4,lin3/lin4,yi4,jue2,ge4/ma1/ma,shi4,,yu2/yu1/wu1,si4,sui4,gen4,ya4,qi2/ji1/ji4/zi1/zhai1/jian4,ya4,da4/dai4/ta4i/xiao3,ye/ran/nan/yeok,xiang3,jing1,ye4/ri4,you4,dan3/dan4,lian2,duo3,wei3/men2,ji2,ji2,wang2/wu2,ba1,bing1,fo2/fu2/bi4/bo2/fang3,jin1,bing1,mao4/xian1,tuo1/cha4/duo2,hong2/gong1,gan3/han4,bo2,chao4,miao3/chang2," + _
- …………
- "ke1,mu3,di3,quan4,quan2,zi4,mang2,keng1/qian1,qian1,li2,pou3,gang1,zhi2/te4,ben1/ben4,quan2,chun2,jia1,feng1,ke1,ju2,chu2,xi4,bei4,luo4,jie4,ma2,san1,wei4,mao2/li2,dun1,tong2,qiao2,xi1,li4,du2,lie4,bai2,piao1,bao4,xi1,chou1,wei2,kui2/wei2,chou1,quan3/ba2,ji3,chai2,zhuo2/bao4,ge1,kang4/gang3,pei4/fei4,hou3,ya4,yin2,huan1/fan1,zhuang4,kuang2,zhong4,mu4,pi1,ju2,yi2/quan2/chi2,sheng1/xing1,tuo2/yi2,ling2,pi1,ni3,yao3,you4,xue4,dan4,bo2"
-
- Dim i%, j%, k%, a, b, c, d
-
- With CreateObject("VBSCRIPT.REGEXP")
- .Global = True
- '.Pattern = "[0-9]"
- .Pattern = "[0-9][^\,\/]"
- For j = 1 To 32
- a = Split(PYSJ(j), ",")
- For k = 0 To UBound(a)
- For i = 0 To .Execute(a(k)).Count - 1
- Stop
- Next
- Next
- Next
- End With
- End Sub
复制代码 |