VB.NET 汉字转拼音

VB.NET 汉字转拼音;转化率达百分之90以上

Public Class cls_hzp

Function get_py(ByVal str As String) As String

Dim strasc

strasc = Asc(str)

Select Case strasc

Case -20319 To -20318 : get_py = "a "

Case -20317 To -20305 : get_py = "ai "

Case -20304 To -20296 : get_py = "an "

Case -20295 To -20293 : get_py = "ang "

Case -20292 To -20284 : get_py = "ao "

Case -20283 To -20266 : get_py = "ba "

Case -20265 To -20258 : get_py = "bai "

Case -20257 To -20243 : get_py = "ban "

Case -20242 To -20231 : get_py = "bang "

Case -20230 To -20052 : get_py = "bao "

Case -20051 To -20037 : get_py = "bei "

Case -20036 To -20033 : get_py = "ben "

Case -20032 To -20027 : get_py = "beng "

Case -20026 To -20003 : get_py = "bi "

Case -20002 To -19991 : get_py = "bian "

Case -19990 To -19987 : get_py = "biao "

Case -19986 To -19983 : get_py = "bie "

Case -19982 To -19977 : get_py = "bin "

Case -19976 To -19806 : get_py = "bing "

Case -19805 To -19785 : get_py = "bo "

Case -19784 To -19776 : get_py = "bu "

Case -19775 To -19775 : get_py = "ca "

Case -19774 To -19764 : get_py = "cai "

Case -19763 To -19757 : get_py = "can "

Case -19756 To -19752 : get_py = "cang "

Case -19751 To -19747 : get_py = "cao "

Case -19746 To -19742 : get_py = "ce "

Case -19741 To -19740 : get_py = "ceng "

Case -19739 To -19729 : get_py = "cha "

Case -19728 To -19726 : get_py = "chai "

Case -19725 To -19716 : get_py = "chan "

Case -19715 To -19541 : get_py = "chang "

Case -19540 To -19532 : get_py = "chao "

Case -19531 To -19526 : get_py = "che "

Case -19525 To -19516 : get_py = "chen "

Case -19515 To -19501 : get_py = "cheng "

Case -19500 To -19485 : get_py = "chi "

Case -19484 To -19480 : get_py = "chong "

Case -19479 To -19468 : get_py = "chou "

Case -19467 To -19290 : get_py = "chu "

Case -19289 To -19289 : get_py = "chuai "

Case -19288 To -19282 : get_py = "chuan "

Case -19281 To -19276 : get_py = "chuang "

Case -19275 To -19271 : get_py = "chui "

Case -19270 To -19264 : get_py = "chun "

Case -19263 To -19262 : get_py = "chuo "

Case -19261 To -19250 : get_py = "ci "

Case -19249 To -19244 : get_py = "cong "

Case -19243 To -19243 : get_py = "cou "

Case -19242 To -19239 : get_py = "cu "

Case -19238 To -19236 : get_py = "cuan "

Case -19235 To -19228 : get_py = "cui "

Case -19227 To -19225 : get_py = "cun "

Case -19224 To -19219 : get_py = "cuo "

Case -19218 To -19213 : get_py = "da "

Case -19212 To -19039 : get_py = "dai "

Case -19038 To -19024 : get_py = "dan "

Case -19023 To -19019 : get_py = "dang "

Case -19018 To -19007 : get_py = "dao "

Case -19006 To -19004 : get_py = "de "

Case -19003 To -18997 : get_py = "deng "

Case -18996 To -18978 : get_py = "di "

Case -18977 To -18962 : get_py = "dian "

Case -18961 To -18953 : get_py = "diao "

Case -18952 To -18784 : get_py = "die "

Case -18783 To -18775 : get_py = "ding "

Case -18774 To -18774 : get_py = "diu "

Case -18773 To -18527 : get_py = "dong "

Case -10068 To -10068 : get_py = "e "

Case -18526 To -18519 : get_py = "fa "

Case -18518 To -18502 : get_py = "fan "

Case -18501 To -18491 : get_py = "fang "

Case -18490 To -18479 : get_py = "fei "

Case -18478 To -18464 : get_py = "fen "

Case -18463 To -18449 : get_py = "feng "

Case -18448 To -18448 : get_py = "fo "

Case -18447 To -18447 : get_py = "fou "

Case -18446 To -18240 : get_py = "fu "

Case -18239 To -18238 : get_py = "ga "

Case -18237 To -18232 : get_py = "gai "

Case -18231 To -18221 : get_py = "gan "

Case -18220 To -18212 : get_py = "gang "

Case -18211 To -18202 : get_py = "gao "

Case -18201 To -18185 : get_py = "ge "

Case -18184 To -18184 : get_py = "gei "

Case -18183 To -18182 : get_py = "gen "

Case -18181 To -18013 : get_py = "geng "

Case -18012 To -17998 : get_py = "gong "

Case -17997 To -17989 : get_py = "gou "

Case -17988 To -17971 : get_py = "gu "

Case -17970 To -17965 : get_py = "gua "

Case -17964 To -17962 : get_py = "guai "

Case -17961 To -17951 : get_py = "guan "

Case -17950 To -17948 : get_py = "guang "

Case -17947 To -17932 : get_py = "gui "

Case -17931 To -17929 : get_py = "gun "

Case -17928 To -17923 : get_py = "guo "

Case -17922 To -17760 : get_py = "ha "

Case -17759 To -17753 : get_py = "hai "

Case -17752 To -17734 : get_py = "han "

Case -17733 To -17731 : get_py = "hang "

Case -17730 To -17722 : get_py = "hao "

Case -17721 To -17704 : get_py = "he "

Case -17703 To -17702 : get_py = "hei "

Case -17701 To -17698 : get_py = "hen "

Case -17697 To -17693 : get_py = "heng "

Case -17692 To -17684 : get_py = "hong "

Case -17683 To -17677 : get_py = "hou "

Case -17676 To -17497 : get_py = "hu "

Case -17496 To -17488 : get_py = "hua "

Case -17487 To -17483 : get_py = "huai "

Case -17482 To -17469 : get_py = "huan "

Case -17468 To -17455 : get_py = "huang "

Case -17454 To -17434 : get_py = "hui "

Case -17433 To -17428 : get_py = "hun "

Case -17427 To -17418 : get_py = "huo "

Case -17417 To -17203 : get_py = "ji "

Case -17202 To -17186 : get_py = "jia "

Case -17185 To -16984 : get_py = "jian "

Case -16983 To -16971 : get_py = "jiang "

Case -16970 To -16943 : get_py = "jiao "

Case -16942 To -16916 : get_py = "jie "

Case -16915 To -16734 : get_py = "jin "

Case -16733 To -16709 : get_py = "jing "

Case -16708 To -16707 : get_py = "jiong "

Case -16706 To -16690 : get_py = "jiu "

Case -16689 To -16665 : get_py = "ju "

Case -16664 To -16658 : get_py = "juan "

Case -16657 To -16648 : get_py = "jue "

Case -16647 To -16475 : get_py = "jun "

Case -16474 To -16471 : get_py = "ka "

Case -16470 To -16466 : get_py = "kai "

Case -16465 To -16460 : get_py = "kan "

Case -16459 To -16453 : get_py = "kang "

Case -16452 To -16449 : get_py = "kao "

Case -16448 To -16434 : get_py = "ke "

Case -16433 To -16430 : get_py = "ken "

Case -16429 To -16428 : get_py = "keng "

Case -4180 To -4180 : get_py = "keng "

Case -16427 To -16424 : get_py = "kong "

Case -16423 To -16420 : get_py = "kou "

Case -16419 To -16413 : get_py = "ku "

Case -16412 To -16408 : get_py = "kua "

Case -16407 To -16404 : get_py = "kuai "

Case -16403 To -16402 : get_py = "kuan "

Case -16401 To -16394 : get_py = "kuang "

Case -16393 To -16221 : get_py = "kui "

Case -16220 To -16217 : get_py = "kun "

Case -16216 To -16213 : get_py = "kuo "

Case -16212 To -16206 : get_py = "la "

Case -16205 To -16203 : get_py = "lai "

Case -16202 To -16188 : get_py = "lan "

Case -16187 To -16181 : get_py = "lang "

Case -16180 To -16172 : get_py = "lao "

Case -16171 To -16170 : get_py = "le "

Case -16169 To -16159 : get_py = "lei "

Case -16158 To -16156 : get_py = "leng "

Case -16155 To -15960 : get_py = "li "

Case -15959 To -15959 : get_py = "lia "

Case -15958 To -15945 : get_py = "lian "

Case -15944 To -15934 : get_py = "liang "

Case -15933 To -15921 : get_py = "liao "

Case -15920 To -15916 : get_py = "lie "

Case -15915 To -15904 : get_py = "lin "

Case -15903 To -15890 : get_py = "ling "

Case -15889 To -15879 : get_py = "liu "

Case -15878 To -15708 : get_py = "long "

Case -15707 To -15702 : get_py = "lou "

Case -15701 To -15682 : get_py = "lu "

Case -15681 To -15668 : get_py = "lv "

Case -15667 To -15662 : get_py = "luan "

Case -15661 To -15660 : get_py = "lue "

Case -15659 To -15653 : get_py = "lun "

Case -15652 To -15641 : get_py = "luo "

Case -15640 To -15632 : get_py = "ma "

Case -15631 To -15626 : get_py = "mai "

Case -15625 To -15455 : get_py = "man "

Case -15454 To -15449 : get_py = "mang "

Case -15448 To -15437 : get_py = "mao "

Case -15436 To -15436 : get_py = "me "

Case -15435 To -15420 : get_py = "mei "

Case -15419 To -15417 : get_py = "men "

Case -15416 To -15409 : get_py = "meng "

Case -15408 To -15395 : get_py = "mi "

Case -15394 To -15386 : get_py = "mian "

Case -15385 To -15378 : get_py = "miao "

Case -15377 To -15376 : get_py = "mie "

Case -15375 To -15370 : get_py = "min "

Case -15369 To -15364 : get_py = "ming "

Case -15363 To -15363 : get_py = "miu "

Case -15362 To -15184 : get_py = "mo "

Case -15183 To -15181 : get_py = "mou "

Case -15180 To -15166 : get_py = "mu "

Case -15165 To -15159 : get_py = "na "

Case -15158 To -15154 : get_py = "nai "

Case -15153 To -15151 : get_py = "nan "

Case -15150 To -15150 : get_py = "nang "

Case -15149 To -15145 : get_py = "nao "

Case -15144 To -15144 : get_py = "ne "

Case -15143 To -15142 : get_py = "nei "

Case -15141 To -15141 : get_py = "nen "

Case -15140 To -15140 : get_py = "neng "

Case -15139 To -15129 : get_py = "ni "

Case -15128 To -15122 : get_py = "nian "

Case -15121 To -15120 : get_py = "niang "

Case -15119 To -15118 : get_py = "niao "

Case -15117 To -15111 : get_py = "nie "

Case -15110 To -15110 : get_py = "nin "

Case -15109 To -14942 : get_py = "ning "

Case -14941 To -14938 : get_py = "niu "

Case -14937 To -14934 : get_py = "nong "

Case -14933 To -14931 : get_py = "nu "

Case -14930 To -14930 : get_py = "nv "

Case -14929 To -14929 : get_py = "nuan "

Case -14928 To -14927 : get_py = "nue "

Case -14926 To -14923 : get_py = "nuo "

Case -14922 To -14922 : get_py = "o "

Case -14921 To -14915 : get_py = "ou "

Case -14914 To -14909 : get_py = "pa "

Case -14908 To -14903 : get_py = "pai "

Case -14902 To -14895 : get_py = "pan "

Case -14894 To -14890 : get_py = "pang "

Case -14889 To -14883 : get_py = "pao "

Case -14882 To -14874 : get_py = "pei "

Case -14873 To -14872 : get_py = "pen "

Case -14871 To -14858 : get_py = "peng "

Case -14857 To -14679 : get_py = "pi "

Case -14678 To -14675 : get_py = "pian "

Case -14674 To -14671 : get_py = "piao "

Case -14670 To -14669 : get_py = "pie "

Case -14668 To -14664 : get_py = "pin "

Case -14663 To -14655 : get_py = "ping "

Case -14654 To -14646 : get_py = "po "

Case -14645 To -14631 : get_py = "pu "

Case -14630 To -14595 : get_py = "qi "

Case -14594 To -14430 : get_py = "qia "

Case -14429 To -14408 : get_py = "qian "

Case -14407 To -14400 : get_py = "qiang "

Case -4145 To -4145 : get_py = "qiang "

Case -14399 To -14385 : get_py = "qiao "

Case -14384 To -14380 : get_py = "qie "

Case -14379 To -14369 : get_py = "qin "

Case -14368 To -14356 : get_py = "qing "

Case -14355 To -14354 : get_py = "qiong "

Case -14353 To -14346 : get_py = "qiu "

Case -14345 To -14171 : get_py = "qu "

Case -14170 To -14160 : get_py = "quan "

Case -14159 To -14152 : get_py = "que "

Case -14151 To -14150 : get_py = "qun "

Case -14149 To -14146 : get_py = "ran "

Case -14145 To -14141 : get_py = "rang "

Case -14140 To -14138 : get_py = "rao "

Case -14137 To -14136 : get_py = "re "

Case -14135 To -14126 : get_py = "ren "

Case -14125 To -14124 : get_py = "reng "

Case -14123 To -14123 : get_py = "ri "

Case -14122 To -14113 : get_py = "rong "

Case -14112 To -14110 : get_py = "rou "

Case -14109 To -14100 : get_py = "ru "

Case -14099 To -14098 : get_py = "ruan "

Case -14097 To -14095 : get_py = "rui "

Case -14094 To -14093 : get_py = "run "

Case -14092 To -14091 : get_py = "ruo "

Case -14090 To -14088 : get_py = "sa "

Case -14087 To -14084 : get_py = "sai "

Case -14083 To -13918 : get_py = "san "

Case -13917 To -13915 : get_py = "sang "

Case -13914 To -13911 : get_py = "sao "

Case -13910 To -13908 : get_py = "se "

Case -13907 To -13907 : get_py = "sen "

Case -13906 To -13906 : get_py = "seng "

Case -3121 To -3121 : get_py = "sheng "

Case -13905 To -13897 : get_py = "sha "

Case -13896 To -13895 : get_py = "shai "

Case -13894 To -13879 : get_py = "shan "

Case -13878 To -13871 : get_py = "shang "

Case -13870 To -13860 : get_py = "shao "

Case -13859 To -13848 : get_py = "she "

Case -13847 To -13832 : get_py = "shen "

Case -13831 To -13659 : get_py = "sheng "

Case -13658 To -13612 : get_py = "shi "

Case -13611 To -13602 : get_py = "shou "

Case -13601 To -13407 : get_py = "shu "

Case -13406 To -13405 : get_py = "shua "

Case -13404 To -13401 : get_py = "shuai "

Case -13400 To -13399 : get_py = "shuan "

Case -13398 To -13396 : get_py = "shuang "

Case -13395 To -13392 : get_py = "shui "

Case -13391 To -13388 : get_py = "shun "

Case -13387 To -13384 : get_py = "shuo "

Case -13383 To -13368 : get_py = "si "

Case -13367 To -13360 : get_py = "song "

Case -13359 To -13357 : get_py = "sou "

Case -13356 To -13344 : get_py = "su "

Case -13343 To -13341 : get_py = "suan "

Case -13340 To -13330 : get_py = "sui "

Case -13329 To -13327 : get_py = "sun "

Case -13326 To -13319 : get_py = "suo "

Case -13318 To -13148 : get_py = "ta "

Case -13147 To -13139 : get_py = "tai "

Case -13138 To -13121 : get_py = "tan "

Case -13120 To -13108 : get_py = "tang "

Case -13107 To -13097 : get_py = "tao "

Case -13096 To -13096 : get_py = "te "

Case -13095 To -13092 : get_py = "teng "

Case -13091 To -13077 : get_py = "ti "

Case -13076 To -13069 : get_py = "tian "

Case -13068 To -13064 : get_py = "tiao "

Case -13063 To -13061 : get_py = "tie "

Case -13060 To -12889 : get_py = "ting "

Case -12888 To -12876 : get_py = "tong "

Case -12875 To -12872 : get_py = "tou "

Case -12871 To -12861 : get_py = "tu "

Case -12860 To -12859 : get_py = "tuan "

Case -12858 To -12853 : get_py = "tui "

Case -12852 To -12850 : get_py = "tun "

Case -12849 To -12839 : get_py = "tuo "

Case -12838 To -12832 : get_py = "wa "

Case -12831 To -12830 : get_py = "wai "

Case -12829 To -12813 : get_py = "wan "

Case -12812 To -12803 : get_py = "wang "

Case -12802 To -12608 : get_py = "wei "

Case -12607 To -12598 : get_py = "wen "

Case -12597 To -12595 : get_py = "weng "

Case -12594 To -12586 : get_py = "wo "

Case -12585 To -12557 : get_py = "wu "

Case -12556 To -12360 : get_py = "xi "

Case -12359 To -12347 : get_py = "xia "

Case -12346 To -12321 : get_py = "xian "

Case -12320 To -12301 : get_py = "xiang "

Case -12300 To -12121 : get_py = "xiao "

Case -12120 To -12100 : get_py = "xie "

Case -12099 To -12090 : get_py = "xin "

Case -12089 To -12075 : get_py = "xing "

Case -12074 To -12068 : get_py = "xiong "

Case -12067 To -12059 : get_py = "xiu "

Case -12058 To -12040 : get_py = "xu "

Case -12039 To -11868 : get_py = "xuan "

Case -11867 To -11862 : get_py = "xue "

Case -11861 To -11848 : get_py = "xun "

Case -11847 To -11832 : get_py = "ya "

Case -11831 To -11799 : get_py = "yan "

Case -11798 To -11782 : get_py = "yang "

Case -11781 To -11605 : get_py = "yao "

Case -11604 To -11590 : get_py = "ye "

Case -11589 To -11537 : get_py = "yi "

Case -11536 To -11359 : get_py = "yin "

Case -11358 To -11341 : get_py = "ying "

Case -11340 To -11340 : get_py = "yo "

Case -11339 To -11325 : get_py = "yong "

Case -11324 To -11304 : get_py = "you "

Case -11303 To -11098 : get_py = "yu "

Case -11097 To -11078 : get_py = "yuan "

Case -11077 To -11068 : get_py = "yue "

Case -11067 To -11056 : get_py = "yun "

Case -11055 To -11053 : get_py = "za "

Case -11052 To -11046 : get_py = "zai "

Case -11045 To -11042 : get_py = "zan "

Case -11041 To -11039 : get_py = "zang "

Case -11038 To -11025 : get_py = "zao "

Case -11024 To -11021 : get_py = "ze "

Case -11020 To -11020 : get_py = "zei "

Case -11019 To -11019 : get_py = "zen "

Case -11018 To -11015 : get_py = "zeng "

Case -11014 To -10839 : get_py = "zha "

Case -10838 To -10833 : get_py = "zhai "

Case -10832 To -10816 : get_py = "zhan "

Case -10815 To -10801 : get_py = "zhang "

Case -10800 To -10791 : get_py = "zhao "

Case -10790 To -10781 : get_py = "zhe "

Case -10780 To -10765 : get_py = "zhen "

Case -10764 To -10588 : get_py = "zheng "

Case -10587 To -10545 : get_py = "zhi "

Case -10544 To -10534 : get_py = "zhong "

Case -10533 To -10520 : get_py = "zhou "

Case -10519 To -10332 : get_py = "zhu "

Case -10331 To -10330 : get_py = "zhua "

Case -10329 To -10329 : get_py = "zhuai "

Case -10328 To -10323 : get_py = "zhuan "

Case -10322 To -10316 : get_py = "zhuang "

Case -10315 To -10310 : get_py = "zhui "

Case -10309 To -10308 : get_py = "zhun "

Case -10307 To -10297 : get_py = "zhuo "

Case -10296 To -10282 : get_py = "zi "

Case -10281 To -10275 : get_py = "zong "

Case -10274 To -10271 : get_py = "zou "

Case -10270 To -10263 : get_py = "zu "

Case -10262 To -10261 : get_py = "zuan "

Case -10260 To -10257 : get_py = "zui "

Case -10256 To -10255 : get_py = "zun "

Case -10250 To -10250 : get_py = "zuo "

Case -10254 To -10254 : get_py = "zuo "

Case -10247 To -10247 : get_py = "zuo "

Case -10248 To -10248 : get_py = "zuo "

Case Else : get_py = str

End Select

End Function

Function hztopy(ByVal str As String) As String

hztopy = ""

For i As Integer = 1 To Len(str) Step 1

hztopy = hztopy & get_py(Mid(str, i, 1))

Next i

Return hztopy

End Function

End Class


原文发布于微信公众号 - VB小源码(vb_xym)

原文发表时间:2018-12-30

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券