汉字词语与拼音相互转换简易实现方法

合集下载

汉字转拼音,excel汉字转拼音的方法及步骤【修复无错版】

汉字转拼音,excel汉字转拼音的方法及步骤【修复无错版】

汉字转拼音,excel汉字转拼音的方法及步骤【修复无错版】店铺为大家带来修复无错版的excel汉字转拼音的方法及步骤,其他网站所提供的代码大部分有错误,修复了d和e为首字母的拼音读取,欢迎大家参考。

excel汉字转拼音的方法及步骤1.启动Excel 2003(其它版本请仿照操作),打开相应的工作表;2.执行“工具→宏→Visual Basic编辑器”命令(或者直接按“Alt+F11”组合键),进入Visual Basic编辑状态;3.执行“插入→模块”命令,插入一个新模块。

再双击插入的模块,进入模块代码编辑状态;4.将代码复制输入其中;Function pinyin(p As String) As Stringi = Asc(p)Select Case iCase -20319 To -20318: pinyin ="a"Case -20317 To -20305: pinyin ="ai"Case -20304 To -20296: pinyin ="an"Case -20295 To -20293: pinyin ="ang"Case -20292 To -20284: pinyin ="ao"Case -20283 To -20266: pinyin ="ba" Case -20265 To -20258: pinyin ="bai" Case -20257 To -20243: pinyin ="ban" Case -20242 To -20231: pinyin ="bang" Case -20230 To -20052: pinyin ="bao" Case -20051 To -20037: pinyin ="bei" Case -20036 To -20033: pinyin ="ben" Case -20032 To -20027: pinyin ="beng" Case -20026 To -20003: pinyin ="bi" Case -20002 To -19991: pinyin ="bian" Case -19990 To -19987: pinyin ="biao" Case -19986 To -19983: pinyin ="bie" Case -19982 To -19977: pinyin ="bin" Case -19976 To -19806: pinyin ="bing" Case -19805 To -19785: pinyin ="bo"Case -19784 To -19776: pinyin ="bu" Case -19775 To -19775: pinyin ="ca" Case -19774 To -19764: pinyin ="cai" Case -19763 To -19757: pinyin ="can" Case -19756 To -19752: pinyin ="cang" Case -19751 To -19747: pinyin ="cao" Case -19746 To -19742: pinyin ="ce" Case -19741 To -19740: pinyin ="ceng" Case -19739 To -19729: pinyin ="cha" Case -19728 To -19726: pinyin ="chai" Case -19725 To -19716: pinyin ="chan" Case -19715 To -19541: pinyin ="chang" Case -19540 To -19532: pinyin ="chao" Case -19531 To -19526: pinyin ="che" Case -19525 To -19516: pinyin ="chen"Case -19515 To -19501: pinyin ="cheng" Case -19500 To -19485: pinyin ="chi" Case -19484 To -19480: pinyin ="chong" Case -19479 To -19468: pinyin ="chou" Case -19467 To -19290: pinyin ="chu" Case -19289 To -19289: pinyin ="chuai" Case -19288 To -19282: pinyin ="chuan" Case -19281 To -19276: pinyin ="chuang" Case -19275 To -19271: pinyin ="chui" Case -19270 To -19264: pinyin ="chun" Case -19263 To -19262: pinyin ="chuo" Case -19261 To -19250: pinyin ="ci" Case -19249 To -19244: pinyin ="cong" Case -19243 To -19243: pinyin ="cou" Case -19242 To -19239: pinyin ="cu"Case -19238 To -19236: pinyin ="cuan" Case -19235 To -19228: pinyin ="cui" Case -19227 To -19225: pinyin ="cun" Case -19224 To -19219: pinyin ="cuo" Case -19218 To -19213: pinyin ="da" Case -19212 To -19039: pinyin ="dai" Case -19038 To -19024: pinyin ="dan" Case -19023 To -19019: pinyin ="dang" Case -19018 To -19007: pinyin ="dao" Case -19006 To -19004: pinyin ="de" Case -19003 To -18997: pinyin ="deng" Case -18996 To -18978: pinyin ="di" Case -18977 To -18962: pinyin ="dian" Case -18961 To -18953: pinyin ="diao" Case -18952 To -18784: pinyin ="die"Case -18783 To -18775: pinyin ="ding" Case -18774 To -18774: pinyin ="diu" Case -18773 To -18764: pinyin ="dong" Case -18763 To -18757: pinyin ="dou" Case -18756 To -18742: pinyin ="du" Case -18741 To -18736: pinyin ="duan" Case -18735 To -18732: pinyin ="dui" Case -18731 To -18723: pinyin ="dun" Case -18722 To -18711: pinyin ="duo" Case -18710 To -18698: pinyin ="e" Case -18697 To -18697: pinyin ="en" Case -18696 To -18527: pinyin ="er" Case -18526 To -18519: pinyin ="fa" Case -18518 To -18502: pinyin ="fan" Case -18501 To -18491: pinyin ="fang"Case -18490 To -18479: pinyin ="fei" Case -18478 To -18464: pinyin ="fen" Case -18463 To -18449: pinyin ="feng" Case -18448 To -18448: pinyin ="fo" Case -18447 To -18447: pinyin ="fou" Case -18446 To -18240: pinyin ="fu" Case -18239 To -18238: pinyin ="ga" Case -18237 To -18232: pinyin ="gai" Case -18231 To -18221: pinyin ="gan" Case -18220 To -18212: pinyin ="gang" Case -18211 To -18202: pinyin ="gao" Case -18201 To -18185: pinyin ="ge" Case -18184 To -18184: pinyin ="gei" Case -18183 To -18182: pinyin ="gen" Case -18181 To -18013: pinyin ="geng"Case -18012 To -17998: pinyin ="gong" Case -17997 To -17989: pinyin ="gou" Case -17988 To -17971: pinyin ="gu" Case -17970 To -17965: pinyin ="gua" Case -17964 To -17962: pinyin ="guai" Case -17961 To -17951: pinyin ="guan" Case -17950 To -17948: pinyin ="guang" Case -17947 To -17932: pinyin ="gui" Case -17931 To -17929: pinyin ="gun" Case -17928 To -17923: pinyin ="guo" Case -17922 To -17760: pinyin ="ha" Case -17759 To -17753: pinyin ="hai" Case -17752 To -17734: pinyin ="han" Case -17733 To -17731: pinyin ="hang" Case -17730 To -17722: pinyin ="hao"Case -17721 To -17704: pinyin ="he" Case -17703 To -17702: pinyin ="hei" Case -17701 To -17698: pinyin ="hen" Case -17697 To -17693: pinyin ="heng" Case -17692 To -17684: pinyin ="hong" Case -17683 To -17677: pinyin ="hou" Case -17676 To -17497: pinyin ="hu" Case -17496 To -17488: pinyin ="hua" Case -17487 To -17483: pinyin ="huai" Case -17482 To -17469: pinyin ="huan" Case -17468 To -17455: pinyin ="huang" Case -17454 To -17434: pinyin ="hui" Case -17433 To -17428: pinyin ="hun" Case -17427 To -17418: pinyin ="huo" Case -17417 To -17203: pinyin ="ji"Case -17202 To -17186: pinyin ="jia" Case -17185 To -16984: pinyin ="jian" Case -16983 To -16971: pinyin ="jiang" Case -16970 To -16943: pinyin ="jiao" Case -16942 To -16916: pinyin ="jie" Case -16915 To -16734: pinyin ="jin" Case -16733 To -16709: pinyin ="jing" Case -16708 To -16707: pinyin ="jiong" Case -16706 To -16690: pinyin ="jiu" Case -16689 To -16665: pinyin ="ju" Case -16664 To -16658: pinyin ="juan" Case -16657 To -16648: pinyin ="jue" Case -16647 To -16475: pinyin ="jun" Case -16474 To -16471: pinyin ="ka" Case -16470 To -16466: pinyin ="kai"Case -16459 To -16453: pinyin ="kang" Case -16452 To -16449: pinyin ="kao" Case -16448 To -16434: pinyin ="ke" Case -16433 To -16430: pinyin ="ken" Case -16429 To -16428: pinyin ="keng" Case -16427 To -16424: pinyin ="kong" Case -16423 To -16420: pinyin ="kou" Case -16419 To -16413: pinyin ="ku" Case -16412 To -16408: pinyin ="kua" Case -16407 To -16404: pinyin ="kuai" Case -16403 To -16402: pinyin ="kuan" Case -16401 To -16394: pinyin ="kuang" Case -16393 To -16221: pinyin ="kui" Case -16220 To -16217: pinyin ="kun"Case -16212 To -16206: pinyin ="la" Case -16205 To -16203: pinyin ="lai" Case -16202 To -16188: pinyin ="lan" Case -16187 To -16181: pinyin ="lang" Case -16180 To -16172: pinyin ="lao" Case -16171 To -16170: pinyin ="le" Case -16169 To -16159: pinyin ="lei" Case -16158 To -16156: pinyin ="leng" Case -16155 To -15960: pinyin ="li" Case -15959 To -15959: pinyin ="lia" Case -15958 To -15945: pinyin ="lian" Case -15944 To -15934: pinyin ="liang" Case -15933 To -15921: pinyin ="liao" Case -15920 To -15916: pinyin ="lie"Case -15915 To -15904: pinyin ="lin" Case -15903 To -15890: pinyin ="ling" Case -15889 To -15879: pinyin ="liu" Case -15878 To -15708: pinyin ="long" Case -15707 To -15702: pinyin ="lou" Case -15701 To -15682: pinyin ="lu" Case -15681 To -15668: pinyin ="lv" Case -15667 To -15662: pinyin ="luan" Case -15661 To -15660: pinyin ="lue" Case -15659 To -15653: pinyin ="lun" Case -15652 To -15641: pinyin ="luo" Case -15640 To -15632: pinyin ="ma" Case -15631 To -15626: pinyin ="mai" Case -15625 To -15455: pinyin ="man" Case -15454 To -15449: pinyin ="mang"Case -15448 To -15437: pinyin ="mao" Case -15436 To -15436: pinyin ="me" Case -15435 To -15420: pinyin ="mei" Case -15419 To -15417: pinyin ="men" Case -15416 To -15409: pinyin ="meng" Case -15408 To -15395: pinyin ="mi" Case -15394 To -15386: pinyin ="mian" Case -15385 To -15378: pinyin ="miao" Case -15377 To -15376: pinyin ="mie" Case -15375 To -15370: pinyin ="min" Case -15369 To -15364: pinyin ="ming" Case -15363 To -15363: pinyin ="miu" Case -15362 To -15184: pinyin ="mo" Case -15183 To -15181: pinyin ="mou" Case -15180 To -15166: pinyin ="mu"Case -15158 To -15154: pinyin ="nai" Case -15153 To -15151: pinyin ="nan" Case -15150 To -15150: pinyin ="nang" Case -15149 To -15145: pinyin ="nao" Case -15144 To -15144: pinyin ="ne" Case -15143 To -15142: pinyin ="nei" Case -15141 To -15141: pinyin ="nen" Case -15140 To -15140: pinyin ="neng" Case -15139 To -15129: pinyin ="ni" Case -15128 To -15122: pinyin ="nian" Case -15121 To -15120: pinyin ="niang" Case -15119 To -15118: pinyin ="niao" Case -15117 To -15111: pinyin ="nie" Case -15110 To -15110: pinyin ="nin"Case -14941 To -14938: pinyin ="niu" Case -14937 To -14934: pinyin ="nong" Case -14933 To -14931: pinyin ="nu" Case -14930 To -14930: pinyin ="nv" Case -14929 To -14929: pinyin ="nuan" Case -14928 To -14927: pinyin ="nue" Case -14926 To -14923: pinyin ="nuo" Case -14922 To -14922: pinyin ="o" Case -14921 To -14915: pinyin ="ou" Case -14914 To -14909: pinyin ="pa" Case -14908 To -14903: pinyin ="pai" Case -14902 To -14895: pinyin ="pan" Case -14894 To -14890: pinyin ="pang" Case -14889 To -14883: pinyin ="pao"Case -14882 To -14874: pinyin ="pei" Case -14873 To -14872: pinyin ="pen" Case -14871 To -14858: pinyin ="peng" Case -14857 To -14679: pinyin ="pi" Case -14678 To -14675: pinyin ="pian" Case -14674 To -14671: pinyin ="piao" Case -14670 To -14669: pinyin ="pie" Case -14668 To -14664: pinyin ="pin" Case -14663 To -14655: pinyin ="ping" Case -14654 To -14646: pinyin ="po" Case -14645 To -14631: pinyin ="pu" Case -14630 To -14595: pinyin ="qi" Case -14594 To -14430: pinyin ="qia" Case -14429 To -14408: pinyin ="qian" Case -14407 To -14400: pinyin ="qiang"Case -14399 To -14385: pinyin ="qiao" Case -14384 To -14380: pinyin ="qie" Case -14379 To -14369: pinyin ="qin" Case -14368 To -14356: pinyin ="qing" Case -14355 To -14354: pinyin ="qiong" Case -14353 To -14346: pinyin ="qiu" Case -14345 To -14171: pinyin ="qu" Case -14170 To -14160: pinyin ="quan" Case -14159 To -14152: pinyin ="que" Case -14151 To -14150: pinyin ="qun" Case -14149 To -14146: pinyin ="ran" Case -14145 To -14141: pinyin ="rang" Case -14140 To -14138: pinyin ="rao" Case -14137 To -14136: pinyin ="re" Case -14135 To -14126: pinyin ="ren"Case -14125 To -14124: pinyin ="reng" Case -14123 To -14123: pinyin ="ri" Case -14122 To -14113: pinyin ="rong" Case -14112 To -14110: pinyin ="rou" Case -14109 To -14100: pinyin ="ru" Case -14099 To -14098: pinyin ="ruan" Case -14097 To -14095: pinyin ="rui" Case -14094 To -14093: pinyin ="run" Case -14092 To -14091: pinyin ="ruo" Case -14090 To -14088: pinyin ="sa" Case -14087 To -14084: pinyin ="sai" Case -14083 To -13918: pinyin ="san" Case -13917 To -13915: pinyin ="sang" Case -13914 To -13911: pinyin ="sao" Case -13910 To -13908: pinyin ="se"Case -13907 To -13907: pinyin ="sen" Case -13906 To -13906: pinyin ="seng" Case -13905 To -13897: pinyin ="sha" Case -13896 To -13895: pinyin ="shai" Case -13894 To -13879: pinyin ="shan" Case -13878 To -13871: pinyin ="shang" Case -13870 To -13860: pinyin ="shao" Case -13859 To -13848: pinyin ="she" Case -13847 To -13832: pinyin ="shen" Case -13831 To -13659: pinyin ="sheng" Case -13658 To -13612: pinyin ="shi" Case -13611 To -13602: pinyin ="shou" Case -13601 To -13407: pinyin ="shu" Case -13406 To -13405: pinyin ="shua" Case -13404 To -13401: pinyin ="shuai"Case -13400 To -13399: pinyin ="shuan" Case -13398 To -13396: pinyin ="shuang" Case -13395 To -13392: pinyin ="shui" Case -13391 To -13388: pinyin ="shun" Case -13387 To -13384: pinyin ="shuo" Case -13383 To -13368: pinyin ="si" Case -13367 To -13360: pinyin ="song" Case -13359 To -13357: pinyin ="sou" Case -13356 To -13344: pinyin ="su" Case -13343 To -13341: pinyin ="suan" Case -13340 To -13330: pinyin ="sui" Case -13329 To -13327: pinyin ="sun" Case -13326 To -13319: pinyin ="suo" Case -13318 To -13148: pinyin ="ta" Case -13147 To -13139: pinyin ="tai"Case -13120 To -13108: pinyin ="tang" Case -13107 To -13097: pinyin ="tao" Case -13096 To -13096: pinyin ="te" Case -13095 To -13092: pinyin ="teng" Case -13091 To -13077: pinyin ="ti" Case -13076 To -13069: pinyin ="tian" Case -13068 To -13064: pinyin ="tiao" Case -13063 To -13061: pinyin ="tie" Case -13060 To -12889: pinyin ="ting" Case -12888 To -12876: pinyin ="tong" Case -12875 To -12872: pinyin ="tou" Case -12871 To -12861: pinyin ="tu" Case -12860 To -12859: pinyin ="tuan" Case -12858 To -12853: pinyin ="tui"Case -12849 To -12839: pinyin ="tuo" Case -12838 To -12832: pinyin ="wa" Case -12831 To -12830: pinyin ="wai" Case -12829 To -12813: pinyin ="wan" Case -12812 To -12803: pinyin ="wang" Case -12802 To -12608: pinyin ="wei" Case -12607 To -12598: pinyin ="wen" Case -12597 To -12595: pinyin ="weng" Case -12594 To -12586: pinyin ="wo" Case -12585 To -12557: pinyin ="wu" Case -12556 To -12360: pinyin ="xi" Case -12359 To -12347: pinyin ="xia" Case -12346 To -12321: pinyin ="xian" Case -12320 To -12301: pinyin ="xiang"Case -12300 To -12121: pinyin ="xiao" Case -12120 To -12100: pinyin ="xie" Case -12099 To -12090: pinyin ="xin" Case -12089 To -12075: pinyin ="xing" Case -12074 To -12068: pinyin ="xiong" Case -12067 To -12059: pinyin ="xiu" Case -12058 To -12040: pinyin ="xu" Case -12039 To -11868: pinyin ="xuan" Case -11867 To -11862: pinyin ="xue" Case -11861 To -11848: pinyin ="xun" Case -11847 To -11832: pinyin ="ya" Case -11831 To -11799: pinyin ="yan" Case -11798 To -11782: pinyin ="yang" Case -11781 To -11605: pinyin ="yao" Case -11604 To -11590: pinyin ="ye"Case -11536 To -11359: pinyin ="yin" Case -11358 To -11341: pinyin ="ying" Case -11340 To -11340: pinyin ="yo" Case -11339 To -11325: pinyin ="yong" Case -11324 To -11304: pinyin ="you" Case -11303 To -11098: pinyin ="yu" Case -11097 To -11078: pinyin ="yuan" Case -11077 To -11068: pinyin ="yue" Case -11067 To -11056: pinyin ="yun" Case -11055 To -11053: pinyin ="za" Case -11052 To -11046: pinyin ="zai" Case -11045 To -11042: pinyin ="zan" Case -11041 To -11039: pinyin ="zang" Case -11038 To -11025: pinyin ="zao"Case -11020 To -11020: pinyin ="zei" Case -11019 To -11019: pinyin ="zen" Case -11018 To -11015: pinyin ="zeng" Case -11014 To -10839: pinyin ="zha" Case -10838 To -10833: pinyin ="zhai" Case -10832 To -10816: pinyin ="zhan" Case -10815 To -10801: pinyin ="zhang" Case -10800 To -10791: pinyin ="zhao" Case -10790 To -10781: pinyin ="zhe" Case -10780 To -10765: pinyin ="zhen" Case -10764 To -10588: pinyin ="zheng" Case -10587 To -10545: pinyin ="zhi" Case -10544 To -10534: pinyin ="zhong" Case -10533 To -10520: pinyin ="zhou"Case -10331 To -10330: pinyin ="zhua" Case -10329 To -10329: pinyin ="zhuai" Case -10328 To -10323: pinyin ="zhuan" Case -10322 To -10316: pinyin ="zhuang" Case -10315 To -10310: pinyin ="zhui" Case -10309 To -10308: pinyin ="zhun" Case -10307 To -10297: pinyin ="zhuo" Case -10296 To -10282: pinyin ="zi" Case -10281 To -10275: pinyin ="zong" Case -10274 To -10271: pinyin ="zou" Case -10270 To -10263: pinyin ="zu" Case -10262 To -10261: pinyin ="zuan" Case -10260 To -10257: pinyin ="zui" Case -10256 To -10255: pinyin ="zun"Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1))Next iEnd Function5.代码输入完成后,直接关闭Visual Basic编辑窗口,返回Excel 编辑状态;6.自定义函数就可以用了,如:选中A2单元格,输入公式:=getpy(A2)。

汉字转成拼音-用html实现

汉字转成拼音-用html实现

近日,买了一台新电脑,终于把CM1.6的古懂机淘汰了,也翻出了以前写的一些好东东,整理整理,拿出来给大家分享。

这是当时写的一个汉字转成拼音的小代码,用HTML网页+Vbscript实现的,很简单,主要是方便使用。

这是简单的页面效果图:以下是代码:<script language="VBscript">Set d = CreateObject("Scripting.Dictionary")'##### the following is ZhongWen BiaoDian'## the file system can't be \ / : ? " < > |d.add " ",-24159 '""d.add ",,",-24158 '"、"d.add ".",-24157 '"。

"d.add "-",-24156 '"~","—","〃","¨","ˇ","ˉ","·"d.add "",-24148 '"‖"d.add "...",-24147 '"…"d.add "'",-24146 '"‘","’"d.add "''",-24144 '"“","”"d.add "[]",-24142 '"〔","〕","〈","〉","《","》","「","」","『","』","〖","〗","【","】"d.add "[+-]",-24128 '"±"d.add "[by]",-24127 '"×"d.add ",",-23636 '","d.add "!",-23647 '"!"d.add "#",-23645 '"#"d.add "%",-23643 '"%"d.add "&",-23642 '"&"d.add "(",-23640 '"("d.add ")",-23639 '")"d.add "[+]",-23637 '"+"d.add "[-]",-23635 '"-"d.add "0",-23632 '"0"d.add "1",-23631 '"1"d.add "2",-23630 '"2"d.add "3",-23629 '"3"d.add "4",-23628 '"4"d.add "5",-23627 '"5"d.add "6",-23626 '"6"d.add "7",-23625 '"7"d.add "8",-23624 '"8"d.add "9",-23623 '"9"d.add "..",-23622 '":"d.add ";",-23621 '";"d.add "=",-23619 '"="d.add "?",-23617 '"?"d.add "@",-23616 '"@" '### Thed.add "A",-23615 '"A"d.add "B",-23614 '"A"d.add "C",-23613 '"A"d.add "D",-23612 '"A"d.add "E",-23611 '"A"d.add "F",-23610 '"A"d.add "G",-23609 '"A"d.add "H",-23608 '"A"d.add "I",-23607 '"A"d.add "J",-23606 '"A"d.add "K",-23605 '"A"d.add "L",-23604 '"A"d.add "M",-23603 '"A"d.add "N",-23602 '"A"d.add "O",-23601 '"A"d.add "P",-23600 '"A"d.add "Q",-23599 '"A"d.add "R",-23598 '"A"d.add "S",-23597 '"A"d.add "T",-23596 '"A"d.add "U",-23595 '"A"d.add "W",-23593 '"A"d.add "X",-23592 '"A"d.add "Y",-23591 '"A"d.add "Z",-23590 '"A"d.add "[",-23589 '"["d.add "['.]",-23588 '"\"d.add "]",-23587 '"]"d.add "_",-23586 '"^","_","`", d.add "a",-23583 '"a"d.add "b",-23582 '"b"d.add "c",-23581 '"c"d.add "d",-23580 '"d"d.add "e",-23579 '"e"d.add "f",-23578 '"f"d.add "g",-23577 '"g"d.add "h",-23576 '"h"d.add "i",-23575 '"i"d.add "j",-23574 '"j"d.add "k",-23573 '"k"d.add "l",-23572 '"l"d.add "m",-23571 '"m"d.add "n",-23570 '"n"d.add "o",-23569 '"o"d.add "p",-23568 '"p"d.add "q",-23567 '"q"d.add "r",-23566 '"r"d.add "s",-23565 '"s"d.add "t",-23564 '"t"d.add "u",-23563 '"u"d.add "v",-23562 '"v"d.add "w",-23561 '"w"d.add "x",-23560 '"x"d.add "y",-23559 '"y"d.add "z",-23558 '"z"d.add "{",-23557 '"{"d.add "[l]",-23556 '"|"d.add "}",-23555 '"}"'#### the following is PinYind.add "A.",-20319d.add "Ai",-20317d.add "An",-20304d.add "Ang",-20295d.add "Ao",-20292d.add "Bai",-20265 d.add "Ban",-20257 d.add "Bang",-20242 d.add "Bao",-20230 d.add "Bei",-20051 d.add "Ben",-20036 d.add "Beng",-20032 d.add "Bi",-20026d.add "Bian",-20002 d.add "Biao",-19990 d.add "Bie",-19986 d.add "Bin",-19982 d.add "Bing",-19976 d.add "Bo",-19805d.add "Bu",-19784d.add "Ca",-19775d.add "Cai",-19774 d.add "Can",-19763 d.add "Cang",-19756 d.add "Cao",-19751 d.add "Ce",-19746d.add "Ceng",-19741 d.add "Cha",-19739 d.add "Chai",-19728 d.add "Chan",-19725 d.add "Chang",-19715 d.add "Chao",-19540 d.add "Che",-19531 d.add "Chen",-19525 d.add "Cheng",-19515 d.add "Chi",-19500 d.add "Chong",-19484 d.add "Chou",-19479 d.add "Chu",-19467 d.add "Chuai",-19289 d.add "Chuan",-19288 d.add "Chuang",-19281 d.add "Chui",-19275 d.add "Chun",-19270 d.add "Chuo",-19263 d.add "Ci",-19261d.add "Cong",-19249 d.add "Cou",-19243d.add "Cuan",-19238 d.add "Cui",-19235 d.add "Cun",-19227 d.add "Cuo",-19224 d.add "Da",-19218 d.add "Dai",-19212 d.add "Dan",-19038 d.add "Dang",-19023 d.add "Dao",-19018 d.add "De",-19006 d.add "Deng",-19003 d.add "Di",-18996 d.add "Dian",-18977 d.add "Diao",-18961 d.add "Die",-18952 d.add "Ding",-18783 d.add "Diu",-18774 d.add "Dong",-18773 d.add "Dou",-18763 d.add "Du",-18756 d.add "Duan",-18741 d.add "Dui",-18735 d.add "Dun",-18731 d.add "Duo",-18722 d.add "E.",-18710 d.add "En",-18697 d.add "Er",-18696 d.add "Fa",-18526 d.add "Fan",-18518 d.add "Fang",-18501 d.add "Fei",-18490 d.add "Fen",-18478 d.add "Feng",-18463 d.add "Fo",-18448 d.add "Fou",-18447 d.add "Fu",-18446 d.add "Ga",-18239 d.add "Gai",-18237 d.add "Gan",-18231 d.add "Gang",-18220 d.add "Gao",-18211 d.add "Ge",-18201 d.add "Gei",-18184d.add "Geng",-18181 d.add "Gong",-18012 d.add "Gou",-17997 d.add "Gu",-17988 d.add "Gua",-17970 d.add "Guai",-17964 d.add "Guan",-17961 d.add "Guang",-17950 d.add "Gui",-17947 d.add "Gun",-17931 d.add "Guo",-17928 d.add "Ha",-17922 d.add "Hai",-17759 d.add "Han",-17752 d.add "Hang",-17733 d.add "Hao",-17730 d.add "He",-17721 d.add "Hei",-17703 d.add "Hen",-17701 d.add "Heng",-17697 d.add "Hong",-17692 d.add "Hou",-17683 d.add "Hu",-17676 d.add "Hua",-17496 d.add "Huai",-17487 d.add "Huan",-17482 d.add "Huang",-17468 d.add "Hui",-17454 d.add "Hun",-17433 d.add "Huo",-17427 d.add "Ji",-17417d.add "Jia",-17202 d.add "Jian",-17185 d.add "Jiang",-16983 d.add "Jiao",-16970 d.add "Jie",-16942 d.add "Jin",-16915 d.add "Jing",-16733 d.add "Jiong",-16708 d.add "Jiu",-16706 d.add "Ju",-16689 d.add "Juan",-16664 d.add "Jue",-16657d.add "Ka",-16474 d.add "Kai",-16470 d.add "Kan",-16465 d.add "Kang",-16459 d.add "Kao",-16452 d.add "Ke",-16448 d.add "Ken",-16433 d.add "Keng",-16429 d.add "Kong",-16427 d.add "Kou",-16423 d.add "Ku",-16419 d.add "Kua",-16412 d.add "Kuai",-16407 d.add "Kuan",-16403 d.add "Kuang",-16401 d.add "Kui",-16393 d.add "Kun",-16220 d.add "kuo",-16216 d.add "La",-16212 d.add "Lai",-16205 d.add "Lan",-16202 d.add "Lang",-16187 d.add "Lao",-16180 d.add "Le",-16171 d.add "Lei",-16169 d.add "Leng",-16158 d.add "Li",-16155 d.add "Lia",-15959 d.add "Lian",-15958 d.add "Liang",-15944 d.add "Liao",-15933 d.add "Lie",-15920 d.add "Lin",-15915 d.add "Ling",-15903 d.add "Liu",-15889 d.add "Long",-15878 d.add "Lou",-15707 d.add "Lu",-15701 d.add "Lv",-15681 d.add "Luan",-15667 d.add "Lue",-15661 d.add "Lun",-15659 d.add "Luo",-15652d.add "Mai",-15631 d.add "Man",-15625 d.add "Mang",-15454 d.add "Mao",-15448 d.add "Me",-15436 d.add "Mei",-15435 d.add "Men",-15419 d.add "Meng",-15416 d.add "Mi",-15408 d.add "Mian",-15394 d.add "Miao",-15385 d.add "Mie",-15377 d.add "Min",-15375 d.add "Ming",-15369 d.add "Miu",-15363 d.add "Mo",-15362 d.add "Mou",-15183 d.add "Mu",-15180 d.add "Na",-15165 d.add "Nai",-15158 d.add "Nan",-15153 d.add "Nang",-15150 d.add "Nao",-15149 d.add "Ne",-15144 d.add "Nei",-15143 d.add "Nen",-15141 d.add "Neng",-15140 d.add "Ni",-15139 d.add "Nian",-15128 d.add "Niang",-15121 d.add "Niao",-15119 d.add "Nie",-15117 d.add "Nin",-15110 d.add "Ning",-15109 d.add "Niu",-14941 d.add "Nong",-14937 d.add "Nu",-14933 d.add "Nv",-14930 d.add "Nuan",-14929 d.add "Nue",-14928 d.add "Nuo",-14926 d.add "O.",-14922 d.add "Ou",-14921d.add "Pai",-14908 d.add "Pan",-14902 d.add "Pang",-14894 d.add "Pao",-14889 d.add "Pei",-14882 d.add "Pen",-14873 d.add "Peng",-14871 d.add "Pi",-14857 d.add "Pian",-14678 d.add "Piao",-14674 d.add "Pie",-14670 d.add "Pin",-14668 d.add "Ping",-14663 d.add "Po",-14654 d.add "Pu",-14645 d.add "Qi",-14630 d.add "Qia",-14594 d.add "Qian",-14429 d.add "Qiang",-14407 d.add "Qiao",-14399 d.add "Qie",-14384 d.add "Qin",-14379 d.add "Qing",-14368 d.add "Qiong",-14355 d.add "Qiu",-14353 d.add "Qu",-14345 d.add "Quan",-14170 d.add "Que",-14159 d.add "Qun",-14151 d.add "Ran",-14149 d.add "Rang",-14145 d.add "Rao",-14140 d.add "Re",-14137 d.add "Ren",-14135 d.add "Reng",-14125 d.add "Ri",-14123 d.add "Rong",-14122 d.add "Rou",-14112 d.add "Ru",-14109 d.add "Ruan",-14099 d.add "Rui",-14097 d.add "Run",-14094 d.add "Ruo",-14092d.add "Sai",-14087 d.add "San",-14083 d.add "Sang",-13917 d.add "Sao",-13914 d.add "Se",-13910d.add "Sen",-13907 d.add "Seng",-13906 d.add "Sha",-13905 d.add "Shai",-13896 d.add "Shan",-13894 d.add "Shang",-13878 d.add "Shao",-13870 d.add "She",-13859 d.add "Shen",-13847 d.add "Sheng",-13831 d.add "Shi",-13658 d.add "Shou",-13611 d.add "Shu",-13601 d.add "Shua",-13406 d.add "Shuai",-13404 d.add "Shuan",-13400 d.add "Shuang",-13398 d.add "Shui",-13395 d.add "Shun",-13391 d.add "Shuo",-13387 d.add "Si",-13383d.add "Song",-13367 d.add "Sou",-13359 d.add "Su",-13356d.add "Suan",-13343 d.add "Sui",-13340 d.add "Sun",-13329 d.add "Suo",-13326 d.add "Ta",-13318d.add "Tai",-13147 d.add "Tan",-13138 d.add "Tang",-13120 d.add "Tao",-13107 d.add "Te",-13096d.add "Teng",-13095 d.add "Ti",-13091d.add "Tian",-13076 d.add "Tiao",-13068d.add "Ting",-13060 d.add "Tong",-12888 d.add "Tou",-12875 d.add "Tu",-12871d.add "Tuan",-12860 d.add "Tui",-12858 d.add "Tun",-12852 d.add "Tuo",-12849 d.add "Wa",-12838 d.add "Wai",-12831 d.add "Wan",-12829 d.add "Wang",-12812 d.add "Wei",-12802 d.add "Wen",-12607 d.add "Weng",-12597 d.add "Wo",-12594 d.add "Wu",-12585 d.add "Xi",-12556 d.add "Xia",-12359 d.add "Xian",-12346 d.add "Xiang",-12320 d.add "Xiao",-12300 d.add "Xie",-12120 d.add "Xin",-12099 d.add "Xing",-12089 d.add "Xiong",-12074 d.add "Xiu",-12067 d.add "Xu",-12058 d.add "Xuan",-12039 d.add "Xue",-11867 d.add "Xun",-11861 d.add "Ya",-11847 d.add "Yan",-11831 d.add "Yang",-11798 d.add "Yao",-11781 d.add "Ye",-11604 d.add "Yi",-11589 d.add "Yin",-11536 d.add "Ying",-11358 d.add "Yo",-11340 d.add "Yong",-11339 d.add "You",-11324d.add "Yuan",-11097d.add "Yue",-11077d.add "Yun",-11067d.add "Za",-11055d.add "Zai",-11052d.add "Zan",-11045d.add "Zang",-11041d.add "Zao",-11038d.add "Ze",-11024d.add "Zei",-11020d.add "Zen",-11019d.add "Zeng",-11018d.add "Zha",-11014d.add "Zhai",-10838d.add "Zhan",-10832d.add "Zhang",-10815d.add "Zhao",-10800d.add "Zhe",-10790d.add "Zhen",-10780d.add "Zheng",-10764d.add "Zhi",-10587d.add "Zhong",-10544d.add "Zhou",-10533d.add "Zhu",-10519d.add "Zhua",-10331d.add "Zhuai",-10329d.add "Zhuan",-10328d.add "Zhuang",-10322d.add "Zhui",-10315d.add "Zhun",-10309d.add "Zhuo",-10307d.add "Zi",-10296d.add "Zong",-10281d.add "Zou",-10274d.add "Zu",-10270d.add "Zuan",-10262d.add "Zui",-10260d.add "Zun",-10256d.add "Zuo",-10254function g(num)if num>0 and num<160 theng=chr(num)elseif num<-24159 or num>-10247 theng=""elsea=d.Itemsb=d.keysfor i=d.count-1 to 0 step -1if a(i)<=num then exit fornextg=b(i)end ifend ifEnd functionfunction ChangeHtoEn(str)ChangeHtoEn=""for i=1 to len(str)ChangeHtoEn=ChangeHtoEn&g(asc(mid(str,i,1))) nextEnd function</script><script language=vbscript><!--function Change()AA=ShuRU.HZ.valueDD = ChangeHtoEn(AA)ShuRu.EN.value=DDend function//--></script><table border=1 cellpadding=10 cellspacing=0 align=center> <tr><td align=center><form id="ShuRu" name="ShuRu"><TEXTAREA rows=8 cols=100 ID="HZ" NAME="HZ">输入汉字,转成拼音!</TEXTAREA><br><br><INPUT type="button" value="Change TO PinYin" ID="Change TO PinYin" NAME="Change TO PinYin" onclick="Change"><br><br><TEXTAREA rows=8 cols=100 ID="EN" NAME="EN"></TEXTAREA></form>CopyRight@ xfStudio 2007.3.22</td></tr></table>。

利用python实现汉字转拼音的2种方法

利用python实现汉字转拼音的2种方法

利⽤python实现汉字转拼⾳的2种⽅法前⾔在浏览博客时,偶然看到了⽤python将汉字转为拼⾳的第三⽅包,但是在实现的过程中发现⼀些参数已经更新,现在将两种⽅法记录⼀下。

xpinyin在⼀些博客中看到,如果要转化成带⾳节的拼⾳,需要传递参数,‘show_tone_marks=True',但我在实际使⽤时发现,已经没有这个参数了,变成了tone_marks,其它的参数和使⽤⽅法,⼀看就明⽩了,写的很清楚。

看下源码:class Pinyin(object):"""translate chinese hanzi to pinyin by python, inspired by flyerhzm's`chinese\_pinyin`_ gemusage-----::>>> from xpinyin import Pinyin>>> p = Pinyin()>>> # default splitter is `-`>>> p.get_pinyin(u"上海")'shang-hai'>>> # show tone marks>>> p.get_pinyin(u"上海", tone_marks='marks')'shàng-hǎi'>>> p.get_pinyin(u"上海", tone_marks='numbers')>>> 'shang4-hai3'>>> # remove splitter>>> p.get_pinyin(u"上海", '')'shanghai'>>> # set splitter as whitespace>>> p.get_pinyin(u"上海", ' ')'shang hai'>>> p.get_initial(u"上")'S'>>> p.get_initials(u"上海")'S-H'>>> p.get_initials(u"上海", u'')'SH'>>> p.get_initials(u"上海", u' ')'S H'请输⼊utf8编码汉字.. _chinese\_pinyin: https:///flyerhzm/chinese_pinyin"""安装:pip install xpinyin代码:from xpinyin import Pinyin# 实例拼⾳转换对象p = Pinyin()# 进⾏拼⾳转换ret = p.get_pinyin(u"汉语拼⾳转换", tone_marks='marks')ret1 = p.get_pinyin(u"汉语拼⾳转换", tone_marks='numbers')print(ret+'\n'+ret1)# 得到转化后的结果# hàn-yǔ-pīn-yīn-zhuǎn-huàn# han4-yu3-pin1-yin1-zhuan3-huan4pypinyin与xpinyin相⽐,pypinyin更强⼤。

js实现中文转拼音的完整步骤记录

js实现中文转拼音的完整步骤记录

js实现中⽂转拼⾳的完整步骤记录使⽤js搞了⼀个中⽂转拼⾳的包,仓库地址可见:特⾊功能⽀持汉字、词语、句⼦多种格式输⼊获取获取拼⾳获取声母获取韵母获取拼⾳⾸字母获取⾳调获取多⾳字的多种拼⾳⽀持字符串和数组两种输出形式安装npm 安装npm install pinyin-proyarn 安装yarn add pinyin-pro引⼊浏览器 script 引⼊:<!--引⼊某个版本,如3.2.0版本--><!-- <script src="https:///gh/zh-lx/pinyin-pro@3.2.0/dist/pinyin-pro.js"></script> --><!--引⼊最新版本--><script src="https:///gh/zh-lx/pinyin-pro@latest/dist/pinyin-pro.js"></script><script>var { pinyin } = pinyinPro;pinyin('汉语拼⾳'); // 'hàn yǔ pīn yīn'</script>ESModule 引⼊:import { pinyin } from 'pinyin-pro';pinyin('汉语拼⾳'); // 'hàn yǔ pīn yīn'commonjs 引⼊:const { pinyin } = require('pinyin-pro');pinyin('汉语拼⾳'); // 'hàn yǔ pīn yīn'参数pinyin(word, options) 接收两个参数word:必填。

中文转拼音的函数

中文转拼音的函数

中文转拼音的函数一、概述中文转拼音是指将汉字转换为对应的拼音(英文字母),以方便国际交流和计算机处理。

在日常生活中,我们经常会使用中文拼音来搜索、输入或标注汉字,因此中文转拼音的函数非常有用,可以帮助我们快速、准确地进行这些操作。

本文将介绍如何编写一个功能完备的中文转拼音的函数,以满足各种实际需求。

二、拼音系统拼音系统是指将汉字按照一定的规则转换为对应的拼音的方法和标准。

目前常用的拼音系统有汉语拼音、注音符号、粤语拼音等。

在本文中,我们将以汉语拼音为基础,讲解如何实现中文转拼音的函数。

三、常见的中文转拼音方法中文转拼音的方法有很多种,例如:1.首字母缩写法:根据汉字的拼音首字母进行缩写,如”中国”可以转换为”ZG”;2.全拼法:将每个汉字根据发音转换为拼音字母,如”中国”可以转换为”zhong guo”;3.多音字处理:在转换过程中,对于拼音有多个读音的汉字,需要根据上下文或词组进行正确的匹配,如”重庆”的读音可以是”chong qing”或”zhong qing”;4.音调标记法:在拼音的基础上,使用数字或符号表示声调,如”zhōng guó”表示”中国”的拼音。

下面我们将以全拼法为例,介绍如何编写一个函数来实现中文转拼音。

四、Python实现中文转拼音的函数1. 安装拼音库为了方便地实现中文转拼音的功能,我们可以使用Python的拼音库,例如pypinyin库。

可以使用以下命令来安装该库:pip install pypinyin2. 导入拼音库安装完成后,我们需要在Python代码中导入该库,并进行初始化操作:import pypinyinpypinyin.load_phrases_dict()3. 编写转换函数接下来,我们可以编写一个函数来实现中文转拼音的功能:def chinese_to_pinyin(chinese_str):pinyin_list = pypinyin.pinyin(chinese_str, style=pypinyin.NORMAL) pinyin_str_list = []for pinyin in pinyin_list:pinyin_str_list.append(pinyin[0])return ' '.join(pinyin_str_list)4. 使用示例我们可以使用以下代码来测试刚刚编写的中文转拼音函数:chinese_str = "中国"pinyin = chinese_to_pinyin(chinese_str)print(pinyin) # 输出:"zhong guo"五、进阶功能扩展1. 多音字处理在实际应用中,由于汉字存在多音字的情况,因此需要对多音字进行正确的匹配。

拼音转换:将文档中的汉字转换为拼音

拼音转换:将文档中的汉字转换为拼音

拼音转换:将文档中的汉字转换为拼音
本文档旨在介绍如何将文档中的汉字转换为拼音。

拼音转换可
以方便读者快速识别和发音汉字,提升阅读体验。

以下是一种简单
的方法,供参考:
1. 引入必要的库和工具
首先,你需要确保你的计算机上安装了能够进行拼音转换的库
和工具。

推荐使用Python编程语言,并安装相关的库如`pypinyin`。

2. 读取文档内容
使用适当的方法读取文档的内容,可以是通过读取文件或者从
其他来源获取文本内容。

3. 分割文档内容
对文档的内容进行分割,以便逐个处理每个汉字。

可以使用空
格或其他分隔符将文档内容拆分成单个词语。

4. 汉字转换为拼音
对每个汉字进行拼音转换。

使用`pypinyin`库的转换功能将汉字转换为对应的拼音音节,可以选择转换成带声调的拼音或者不带声调的拼音。

5. 拼音替换文档内容
将转换后的拼音替换原文档中的每个汉字。

可以使用简单的字符串替换方法,将汉字替换为拼音音节。

6. 保存转换后的文档
将转换后带拼音的文档保存到指定的位置。

可以选择覆盖原文档或者另存为新的文档。

7. 完成拼音转换
经过以上步骤,你已经成功将文档中的汉字转换为拼音。

现在可以方便地阅读和发音汉字,提高文档的可读性。

请注意,以上方法是一种简单的策略,旨在提供基本的拼音转换功能。

具体实现细节和代码可以根据你的需要进行进一步的调整和优化。

希望这份文档可以对你有所帮助!。

JAVA实现汉字转拼音功能代码实例

JAVA实现汉字转拼音功能代码实例

JAVA实现汉字转拼⾳功能代码实例JAVA中汉字转拼⾳的⽅法并不复杂,可以使⽤pinyin4j包来实现。

⼀、下载pinyin4j的架包,并导⼊项⽬中,如下:如果是maven项⽬,maven依赖如下:<dependency><groupId>com.belerweb</groupId><artifactId>pinyin4j</artifactId><version>2.5.0</version></dependency>⼆、汉字转拼⾳⽅法,附上代码例⼦,如下:public class PinyinUtil {public static void main(String[] args) throws Exception {System.out.println(getPinyin("haha你笑起来真好看", " "));System.out.println(getPinyinInitials("你笑起来真好看"));}/*** 将汉字转换为全拼** @param text ⽂本* @param separator 分隔符* @return {@link String}*/public static String getPinyin(String text, String separator) {char[] chars = text.toCharArray();HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();// 设置⼤⼩写format.setCaseType(HanyuPinyinCaseType.LOWERCASE);// 设置声调表⽰⽅法format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);// 设置字母u表⽰⽅法format.setVCharType(HanyuPinyinVCharType.WITH_V);String[] s;String rs = StringUtils.EMPTY;try {StringBuilder sb = new StringBuilder();for (int i = 0; i < chars.length; i++) {// 判断是否为汉字字符if (String.valueOf(chars[i]).matches("[\\u4E00-\\u9FA5]+")) {s = PinyinHelper.toHanyuPinyinStringArray(chars[i], format);if (s != null) {sb.append(s[0]).append(separator);continue;}}sb.append(String.valueOf(chars[i]));if ((i + 1 >= chars.length) || String.valueOf(chars[i + 1]).matches("[\\u4E00-\\u9FA5]+")) {sb.append(separator);}}rs = sb.substring(0, sb.length() - 1);} catch (BadHanyuPinyinOutputFormatCombination e) {e.printStackTrace();}return rs;}/*** 获取汉字⾸字母** @param text ⽂本* @return {@link String}*/public static String getPinyinInitials(String text) {StringBuilder sb = new StringBuilder();for (int i = 0; i < text.length(); i++) {char ch = text.charAt(i);String[] s = PinyinHelper.toHanyuPinyinStringArray(ch); if (s != null) {sb.append(s[0].charAt(0));} else {sb.append(ch);}}return sb.toString();}}其中,拼⾳格式参数说明:HanyuPinyinCaseType设置拼⾳的⼤⼩写LOWERCASE⼩写UPPERCASE⼤写HanyuPinyinToneType设置拼⾳的⾳调WITH_TONE_NUMBER⽤数字表⽰⾳调。

Excel和Word中怎么把汉字转化为拼音【百科全说】

Excel和Word中怎么把汉字转化为拼音【百科全说】

Excel和Word中怎么把汉字转化为拼音【百科全说】我们可以利用Excel和word软件将汉字转换成拼音,具体怎么操作呢?小编为大家解答这个问题。

具体如下:1.1. 第一步,请大家先复制A列内容到WORD里,当我们粘贴时,请点击“只保留文本”这一项。

2.2.第二步,请大家点击选择自己想标注拼音的汉字,然后点击屏幕左上方的“开始”菜单,接着选择“拼音指南”即可。

3.3. 第三步,出现了如图所示的界面。

4.4. 第四步,我们不需要设置太多,请选择【确定】即可,效果如图。

5.5. 第五步,请大家复制拼音和汉字,然后将其粘贴到刚刚EXCEL里的C列即可。

6.6. 最后,请大家在B2中输入=PHONETIC(C2)然后下拉复制公式,就会出现如图所示的结果,操作完成。

7.以上就是Excel和Word中把汉字转化为拼音的方法。

时间:2019-09-24 02:43 / 作者:百科全说WORD中如何输入汉字拼音中的一二三四声?12/09 04:33问题:WORD中如何输入汉字拼音中的一二三四声? 请详细解答说明,谢谢! 解答:选择拼音打字法,然后把光标放在拼音打字标示条最右边的键盘标志上,点右键选择拼音,然后在电脑屏幕上就会出现一个可以打拼音的键盘,在上面点击你要输入的拼音字母就可以了? excel或word中的表格无法复制到ppt中去怎么办?08/14 15:20出现这样的情况,可能存在下面的原因: 1.系统存在问题或OFFICE 软件存在问题: 2.表格过大,导至PPT一页无法全部显示. 解决办法(前题的OFFICE软件和系统软件正常.无故障) 1.重新调整表格尺寸,使之适应PPT页面: 2.在PPT软件中选择"标题和表格"版式,直接里该页面制表.3.在EXCEL或WORD中制一个小表,看是否可以复制到PPT里去.如果可以,证明OFFICE软件没问题,如果不可以你就要考虑重装或修复OFFICE了!在Word中怎么为汉字添加拼音?word汉字加拼音方法02/11 13:46为了满足制作一些特殊需要的文档,除了在word里可以输入中文和英文字符,还可以为中文添加拼音,下面我们一起来看看吧! 1.打开word软件,打开或者新建一篇文档. 2.选中要添加拼音的文字.一次可以选中多个汉字,不必一个一个的进行操作.依次点击“开始”,“拼音指南”. 3.在拼音指南”窗口,依次在表格里输入拼音,因为软件不能不会自动识别汉字导出拼音. 4.更改对齐方式为“居中”,因为上图中字母的间距太大了. 5.偏移量是指汉字与拼音之间的距离是多大,默认0就可以,按自己的要求也可以更改. 6.甚怎么在Excel或者Word中插入自己的签名11/18 21:59有的小伙伴制作了一份报价Word或者Excel文档,为了证明这是自己的报价文件,因此想要插入自己的签名,但是却不知道如何插入,那么小编就来为大家介绍一下吧.具体如下:1. 第一步,我们需要一份属于自己的PNG文件的签名,小编想要在这儿提醒一下,签名的文件一定是PNG格式的矢量图,可以在PS中制作签名.2. 第二步,双击或者右击打开需要的放置签名的文档.3. 第三步,来到下图所示的文档页面后,点击需要插入签名的位置,接着点击页面顶部的插入选项,然后点击箭头所指的图片选项. 4. 第四步,在图片窗口如何在excel或Word中画出斜的波浪线08/06 15:45在word中画出斜波浪线方法: 通过插入--文本框绘制出一个文本框,在文本框中连续按空格,选中空格,添加波浪式的下划线: 通过旋转文本框,使波浪线倾斜: 选中文本框,右键点击,选择设置形状格式,把形状填充和线条颜色都设置为无即可.Word中怎么将繁体字转化为简体字05/23 14:24在网上搜索相关技术文档或者论文材料的时候,经常会遇到一些繁体文档。

汉字教学方法

汉字教学方法

汉字教学方法汉字是中国文化的精髓,是中文的基础和核心。

汉字教学方法对于学习者的汉字水平提高和语言能力的发展至关重要。

本文将探讨几种有效的汉字教学方法,旨在帮助学习者更好地掌握和运用汉字。

一、拼音与汉字结合教学法拼音是学习汉字的第一步,它是学习者理解和掌握汉字发音的基础。

拼音与汉字结合教学法将拼音与相应的汉字进行搭配教学,即在教学过程中,将汉字的发音与拼音进行对照和学习。

这种方法可以帮助学习者准确地理解和掌握汉字发音规律,提高学习效率。

二、视觉教学法汉字是一种特殊的视觉符号,视觉教学法是通过图像和视觉印象来教授和学习汉字。

教师可以利用汉字的形状、笔画和结构特点,通过图片、动画等视觉工具,激发学习者的学习兴趣和记忆力。

同时,视觉教学法也可以帮助学习者形成对汉字的整体认识,并提高对汉字的辨别和运用能力。

三、故事教学法故事教学法是一种生动有趣的教学方法,通过讲述和编织故事情节,将汉字的意义和用法融入其中,以提高学习者对汉字的记忆和理解能力。

教师可以选取一些有趣的故事和典故来讲解和解释汉字的来源和意义,激发学习者的学习兴趣。

通过故事中的情节和形象的描述,学习者可以更好地理解和运用汉字。

四、词语联想教学法词语联想教学法是通过将汉字与常用词汇进行联想和搭配,以帮助学习者记忆和理解汉字的意义和用法。

教师可以给学习者提供一些词语或诗句,让他们通过联想推测其中的汉字意义和结构。

这种方法可以帮助学习者更好地理解和记忆汉字,提高学习效果。

五、分级教学法分级教学法是根据学习者的汉字水平和学习进度,将汉字按照不同的难易程度进行分类和教学。

教师可以根据学习者的实际情况设定合适的学习目标和阶段性任务,逐步引导学习者通过识字、认字、会写等不同的阶段来掌握汉字。

分级教学法可以帮助学习者渐进式地提高汉字水平,避免学习过程中的困惑和挫败感。

综上所述,汉字教学方法是提高学习者汉字水平和语言能力的重要途径。

教师可以根据学习者的实际情况和学习目标选择合适的教学方法,结合多种教学手段,使学习者在教学中能够更好地掌握和运用汉字。

中文转为拼音的公式

中文转为拼音的公式

中文转为拼音的公式
中文转拼音的公式通常是基于汉语拼音方案设计的。

汉语拼音方案是
一种将汉字转化为拉丁字母的方法,以表达汉字的音素特征。

以下是一个
简单的中文转拼音的公式:
假设输入的中文文本为S,其长度为n(以汉字为单位)。

创建一个空列表P,用于存储拼音结果。

对于每一个字i(i=1到n):
将字i转换为拼音p。

将p添加到列表P中。

输出列表P,即为中文文本的拼音结果。

拼音的转换过程通常包括以下几个步骤:
1.匹配声母和韵母:
将字i的声母部分与相应的拼音声母进行匹配得到声母p_s,并将其
添加到拼音结果p中。

将字i的韵母部分与相应的拼音韵母进行匹配得到韵母p_y,并将其
添加到拼音结果p中。

2.处理声调:
获取字i的声调,例如:ā(第一声)、á(第二声)、ǎ(第三声)、à(第四声)或a(轻声)。

将声调信息添加到拼音结果p的相应位置。

3.处理声母和韵母的组合:
如有需要,根据拼音方案的规则对声母和韵母进行组合处理,得到最终的拼音结果。

以上是一个简单的中文转拼音的公式,具体的实现可能因拼音方案的不同而有所差异。

汉字转拼音公式

汉字转拼音公式

将汉字转换为拼音,可以使用以下两种方法:
方法一(使用Office Excel 2007):
1. 打开一个新的Excel文档。

2. 在D2单元格中输入“=getpy(C2)”,然后按回车键确认。

3. 将鼠标放在D2单元格右下角,当出现“+”后,向下拖动鼠标。

4. 这样,姓名一栏所有的汉字都以拼音形式显示了。

5. 如果需要将拼音的首字母变成大写,可以将鼠标标定在E2单元格中,然后输入“=PROPER(D2)”,按回车键确认。

6. 重复步骤3~5,即可将所有汉字转换为拼音。

方法二(使用Word文档和拼音指南功能):
1. 打开一个新的Word文档,并将表格中的员工姓名复制到Word文档中。

2. 按下CTRL+A,选择所有数据,确保整个文档被选中。

3. 在开始选项卡下找到拼音指南,并点击确认。

这样,Word文档中的汉字都会附带上拼音。

4. 将Word文档中的数据全选并复制回到Excel表格的B列中。

5. 在C列中,输入“=PH”,并选择第2个公式,引用B1单元格。

整体公式为:“=PHONETIC(B1)”。

6. 按回车键确认后即可得到转换后的结果。

通过以上方法,您可以轻松地将汉字转换为拼音,并将其导入Excel表格中进行分析和处理。

将汉字转换为汉语拼音java实现

将汉字转换为汉语拼音java实现

将汉字转换为汉语拼⾳java实现有的时候我们需要将中⽂转换成汉语拼⾳,将汉字转换成汉语拼⾳其实挺简单。

⾸先我找到了⼀个资源,是⼀个XML⽂件:,这个⽂件中每个汉字作为⼀个节点,该节点下有该汉字对应的汉语拼⾳,我的⽅法就是读取这个⽂件。

import java.util.List;import org.dom4j.Element;import com.yesoft.jdbcgeneric.constant.ConstantEnum;public class HzChangeToPy {/*** 将中⽂字符串转换成汉语拼⾳* @param wenzi* @return*/public String toPinYin(String wenzi){//XMLReader是⼀个读取xml⽂件的⼯具类,getRootElement()是将读取的xml⽂件内容返回为Element类型,这⾥我们解析xml使⽤的是dom4j。

XMLReader xmlReader = new XMLReader(ConstantEnum.PINYINXML.toString());Element commonElement = xmlReader.getRootElement();//Element wenziElement = commonElement.element("NewDataSet");String pyStr = "";List<Element> wenziList = commonElement.elements();String[] str = chai(wenzi);for(int i = 0;i < str.length;i++){for (Element el : wenziList) {String name = el.elementText("wenzi");if (name.equals(str[i])) {pyStr += el.elementText("zimu");}}}return pyStr;}/*** 将中⽂字符串拆解为单个字的数组* @param wenzi* @return*/public String[] chai(String wenzi){int length = wenzi.length();String[] str = new String[length];for(int i = 0;i<length;i++){str[i] = wenzi.substring(i,i+1);}return str;}public static void main(String[] args){HzChangeToPy py = new HzChangeToPy();String srt = py.toPinYin("张三");System.out.println(srt);}}这样张三就能转换成zhangsan了。

二年级语文公式大全

二年级语文公式大全

二年级语文公式大全
1. 词语拼音转换公式
对于一个汉字,如果知道其拼音的声母和韵母,可以通过以下公式得到拼音:
拼音 = 声母 + 韵母
例如,对于汉字“爱”,其声母为“a”,韵母为“i”,所以拼音为“ai”。

2. 词语字形结构公式
对于一个汉字,可以通过以下公式来描述其字形结构:
字形 = 上部 + 中部 + 下部
字形是指一个汉字的组成部分,上部、中部和下部是汉字的常见组合方式。

例如,对于汉字“好”,其字形可以用公式表示为“女 + 子 + 子”。

3. 成语辨析思维公式
对于一组成语,可以通过以下公式来辨析其含义:
含义 = 词义1 + 关键词 + 词义2
通过找到成语中的关键词,并结合词义1和词义2,可以准确理解成语的含义。

例如,对于成语“亡羊补牢”,其中的关键词是“亡羊”和“补牢”,结合词义1“失去了一只羊”和词义2“修补牢笼”,可以理解成语的含义为“事情已经发生了损失,但及时补救可以避免更大的损失”。

以上是二年级语文公式的一部分,通过运用这些公式,可以更好地理解和学习语文知识。

java实现将汉语转换为拼音功能

java实现将汉语转换为拼音功能

java实现将汉语转换为拼⾳功能这⼏天在做项⽬的时候⽤到了通过拼⾳去数据库表⾥⾯去模糊查询汉语字段,刚开始的时候感觉特别神奇,查了好多资料,直接去模糊查询是能实现的,但是貌似很复杂。

所以最终取了⼀个⽐较容易的⽅案,就是给数据库表⾥⾯新加了⼀个拼⾳字段。

完美的解决了这个问题,虽说可以这么⼲,但是数据这么多,全部转换为拼⾳(⼈⼀个⼀个区输⼊,有点不现实)。

于是就在⽹上找呀找,就找到了⼀段直接将汉语转换为拼⾳的⼀段代码,在这和⼤家分享⼀下。

所需jar:pinyin4j-2.5.0.jarpublic static void main(String[] args) {System.out.println(getPingYin("⼩龙驿站"));}public static String getPingYin(String str) {char[] t1 = null;t1 = str.toCharArray();String[] t2 = new String[t1.length];HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);t3.setVCharType(HanyuPinyinVCharType.WITH_V);String t4 = "";int t0 = t1.length;try {for (int i = 0; i < t0; i++) {// 判断能否为汉字?if (Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) {t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);// 将汉字的⼏种全拼都存到t2数组?t4 += t2[0];// 取出该汉字全拼的第⼀种读⾳并连接到字符串t4?} else {// 如果不是汉字字符,间接取出字符并连接到字符串t4?t4 += Character.toString(t1[i]);}}} catch (BadHanyuPinyinOutputFormatCombination e) {e.printStackTrace();}return t4;以上所述是⼩编给⼤家介绍的java实现将汉语转换为拼⾳功能,希望对⼤家有所帮助!。

中拼音互译翻译

中拼音互译翻译

中拼音互译翻译是指将中文文本中的拼音转换为相应的汉字,或将汉字转换为相应的拼音。

这种翻译可以帮助人们更
好地理解中文文本,尤其是对于那些不懂中文拼音的人来说。

在中文拼音互译翻译中,需要注意以下几点:
1. 准确性:拼音和汉字之间可能存在多个对应的可能,
因此需要确保选择的汉字是准确的,没有歧义。

2. 完整性:需要确保所有的拼音都被正确地转换成了相
应的汉字,没有遗漏或错误。

3. 流畅性:在转换过程中,需要注意保持文本的流畅性
和自然性,避免出现生硬或奇怪的词语。

汉字如何转化成拼音?

汉字如何转化成拼音?

汉字如何转化成拼音?
前言
一向对车很有研究的吴同学,经常自己DIY,比如换个机油啊,清理个积碳啊等等,但是也经常问我EXCEL的问题,昨天又出了道难题给我。

如何把中文转换成拼音?
我说我研究一下吧,好像WORD有这个功能来着,吴同学好像等不及了,说还是手输吧,反正也不多,看看,动手能力强的人,就是说干就干。

活干完了,不等于问题解决了,老崔还是要研究一下的,如果中文太多了你还会用手一个个输吗?你不会输错吗?说不定下次还会用得着,不如研究到底,下次就可以坐享其成了。

话不多说,进入正题
解题思路
EXCEL中A列为汉字,要求在B列返回对应的拼音
01
首先复制A列内容到WORD中,粘贴选项选择为“只保留文本”,如下图所示:
02
选择要标注拼音的汉字,在“开始”菜单,下面点击“拼音指南”。

弹出对话框,如下图所示:
不需要太多设置,直接点击确定,结果如下:
看看,拼音是不是出来了,以后有不认识的字,或者文章,可以用此方法直接转换成少儿版的了。

03
复制拼音和汉字,把其粘贴到刚才EXCEL中的C列,如下图所示:
04
那么如何获取单独的拼音呢?
讲这个之前,你是否记得讲字符连接时,好像讲过一个Phonetic 函数,此函数毛病还挺多,公式不行,数字也不行,好像只有文本才可以连接起来,具体参照下面的超链接看一下:
说来也不怪他,本身干那个就是个业余爱好,它真正的主营业务就是获取拼音的,我们试一下:
在B2中输入
=PHONETIC(C2)
下拉复制公式,结果如下:。

电子表格、WPS单元格 汉字转拼音的方法

电子表格、WPS单元格 汉字转拼音的方法

电子表格、WPS单元格汉字转拼音的方法第一步:该界面下,使用Alt+F11打开VB代码编辑窗口,第二步:点击插入-模块。

双击打开模块1 vb编辑窗口。

如下图第三步:以下代码复制到窗体中Function pinyin(p As String) As String i = Asc(p)Select Case iCase -20319To -20318: pinyin = "a " Case -20317To -20305: pinyin = "ai " Case -20304To -20296: pinyin = "an " Case -20295To -20293: pinyin = "ang " Case -20292To -20284: pinyin = "ao "Case -20265To -20258: pinyin = "bai " Case -20257To -20243: pinyin = "ban " Case -20242To -20231: pinyin = "bang " Case -20230To -20052: pinyin = "bao " Case -20051To -20037: pinyin = "bei " Case -20036To -20033: pinyin = "ben " Case -20032To -20027: pinyin = "beng " Case -20026To -20003: pinyin = "bi " Case -20002To -19991: pinyin = "bian " Case -19990To -19987: pinyin = "biao " Case -19986To -19983: pinyin = "bie " Case -19982To -19977: pinyin = "bin " Case -19976To -19806: pinyin = "bing " Case -19805To -19785: pinyin = "bo " Case -19784To -19776: pinyin = "bu " Case -19775To -19775: pinyin = "ca " Case -19774To -19764: pinyin = "cai " Case -19763To -19757: pinyin = "can " Case -19756To -19752: pinyin = "cang " Case -19751To -19747: pinyin = "cao " Case -19746To -19742: pinyin = "ce "Case -19739To -19729: pinyin = "cha " Case -19728To -19726: pinyin = "chai " Case -19725To -19716: pinyin = "chan " Case -19715To -19541: pinyin = "chang " Case -19540To -19532: pinyin = "chao " Case -19531To -19526: pinyin = "che " Case -19525To -19516: pinyin = "chen " Case -19515To -19501: pinyin = "cheng " Case -19500To -19485: pinyin = "chi " Case -19484To -19480: pinyin = "chong " Case -19479To -19468: pinyin = "chou " Case -19467To -19290: pinyin = "chu " Case -19289To -19289: pinyin = "chuai " Case -19288To -19282: pinyin = "chuan " Case -19281To -19276: pinyin = "chuang " Case -19275To -19271: pinyin = "chui " Case -19270To -19264: pinyin = "chun " Case -19263To -19262: pinyin = "chuo " Case -19261To -19250: pinyin = "ci " Case -19249To -19244: pinyin = "cong " Case -19243To -19243: pinyin = "cou "Case -19238To -19236: pinyin = "cuan " Case -19235To -19228: pinyin = "cui " Case -19227To -19225: pinyin = "cun " Case -19224To -19219: pinyin = "cuo " Case -19218To -19213: pinyin = "da " Case -19212To -19039: pinyin = "dai " Case -19038To -19024: pinyin = "dan " Case -19023To -19019: pinyin = "dang " Case -19018To -19007: pinyin = "dao " Case -19006To -19004: pinyin = "de " Case -19003To -18997: pinyin = "deng " Case -18996To -18978: pinyin = "di " Case -18977To -18962: pinyin = "dian " Case -18961To -18953: pinyin = "diao " Case -18952To -18784: pinyin = "die " Case -18783To -18775: pinyin = "ding " Case -18774To -18774: pinyin = "diu " Case -18773To -18527: pinyin = "dong " Case -18526To -18519: pinyin = "fa " Case -18518To -18502: pinyin = "fan " Case -18501To -18491: pinyin = "fang "Case -18478To -18464: pinyin = "fen " Case -18463To -18449: pinyin = "feng " Case -18448To -18448: pinyin = "fo " Case -18447To -18447: pinyin = "fou " Case -18446To -18240: pinyin = "fu " Case -18239To -18238: pinyin = "ga " Case -18237To -18232: pinyin = "gai " Case -18231To -18221: pinyin = "gan " Case -18220To -18212: pinyin = "gang " Case -18211To -18202: pinyin = "gao " Case -18201To -18185: pinyin = "ge " Case -18184To -18184: pinyin = "gei " Case -18183To -18182: pinyin = "gen " Case -18181To -18013: pinyin = "geng " Case -18012To -17998: pinyin = "gong " Case -17997To -17989: pinyin = "gou " Case -17988To -17971: pinyin = "gu " Case -17970To -17965: pinyin = "gua " Case -17964To -17962: pinyin = "guai " Case -17961To -17951: pinyin = "guan " Case -17950To -17948: pinyin = "guang "Case -17931To -17929: pinyin = "gun " Case -17928To -17923: pinyin = "guo " Case -17922To -17760: pinyin = "ha " Case -17759To -17753: pinyin = "hai " Case -17752To -17734: pinyin = "han " Case -17733To -17731: pinyin = "hang " Case -17730To -17722: pinyin = "hao " Case -17721To -17704: pinyin = "he " Case -17703To -17702: pinyin = "hei " Case -17701To -17698: pinyin = "hen " Case -17697To -17693: pinyin = "heng " Case -17692To -17684: pinyin = "hong " Case -17683To -17677: pinyin = "hou " Case -17676To -17497: pinyin = "hu " Case -17496To -17488: pinyin = "hua " Case -17487To -17483: pinyin = "huai " Case -17482To -17469: pinyin = "huan " Case -17468To -17455: pinyin = "huang " Case -17454To -17434: pinyin = "hui " Case -17433To -17428: pinyin = "hun " Case -17427To -17418: pinyin = "huo "Case -17202To -17186: pinyin = "jia " Case -17185To -16984: pinyin = "jian " Case -16983To -16971: pinyin = "jiang " Case -16970To -16943: pinyin = "jiao " Case -16942To -16916: pinyin = "jie " Case -16915To -16734: pinyin = "jin " Case -16733To -16709: pinyin = "jing " Case -16708To -16707: pinyin = "jiong " Case -16706To -16690: pinyin = "jiu " Case -16689To -16665: pinyin = "ju " Case -16664To -16658: pinyin = "juan " Case -16657To -16648: pinyin = "jue " Case -16647To -16475: pinyin = "jun " Case -16474To -16471: pinyin = "ka " Case -16470To -16466: pinyin = "kai " Case -16465To -16460: pinyin = "kan " Case -16459To -16453: pinyin = "kang " Case -16452To -16449: pinyin = "kao " Case -16448To -16434: pinyin = "ke " Case -16433To -16430: pinyin = "ken " Case -16429To -16428: pinyin = "keng "Case -16423To -16420: pinyin = "kou " Case -16419To -16413: pinyin = "ku " Case -16412To -16408: pinyin = "kua " Case -16407To -16404: pinyin = "kuai " Case -16403To -16402: pinyin = "kuan " Case -16401To -16394: pinyin = "kuang " Case -16393To -16221: pinyin = "kui " Case -16220To -16217: pinyin = "kun " Case -16216To -16213: pinyin = "kuo " Case -16212To -16206: pinyin = "la " Case -16205To -16203: pinyin = "lai " Case -16202To -16188: pinyin = "lan " Case -16187To -16181: pinyin = "lang " Case -16180To -16172: pinyin = "lao " Case -16171To -16170: pinyin = "le " Case -16169To -16159: pinyin = "lei " Case -16158To -16156: pinyin = "leng " Case -16155To -15960: pinyin = "li " Case -15959To -15959: pinyin = "lia " Case -15958To -15945: pinyin = "lian " Case -15944To -15934: pinyin = "liang "Case -15933To -15921: pinyin = "liao " Case -15920To -15916: pinyin = "lie " Case -15915To -15904: pinyin = "lin " Case -15903To -15890: pinyin = "ling " Case -15889To -15879: pinyin = "liu " Case -15878To -15708: pinyin = "long " Case -15707To -15702: pinyin = "lou " Case -15701To -15682: pinyin = "lu " Case -15681To -15668: pinyin = "lv " Case -15667To -15662: pinyin = "luan " Case -15661To -15660: pinyin = "lue " Case -15659To -15653: pinyin = "lun " Case -15652To -15641: pinyin = "luo " Case -15640To -15632: pinyin = "ma " Case -15631To -15626: pinyin = "mai " Case -15625To -15455: pinyin = "man " Case -15454To -15449: pinyin = "mang " Case -15448To -15437: pinyin = "mao " Case -15436To -15436: pinyin = "me " Case -15435To -15420: pinyin = "mei " Case -15419To -15417: pinyin = "men " Case -15416To -15409: pinyin = "meng "Case -15394To -15386: pinyin = "mian " Case -15385To -15378: pinyin = "miao " Case -15377To -15376: pinyin = "mie " Case -15375To -15370: pinyin = "min " Case -15369To -15364: pinyin = "ming " Case -15363To -15363: pinyin = "miu " Case -15362To -15184: pinyin = "mo " Case -15183To -15181: pinyin = "mou " Case -15180To -15166: pinyin = "mu " Case -15165To -15159: pinyin = "na " Case -15158To -15154: pinyin = "nai " Case -15153To -15151: pinyin = "nan " Case -15150To -15150: pinyin = "nang " Case -15149To -15145: pinyin = "nao " Case -15144To -15144: pinyin = "ne " Case -15143To -15142: pinyin = "nei " Case -15141To -15141: pinyin = "nen " Case -15140To -15140: pinyin = "neng " Case -15139To -15129: pinyin = "ni " Case -15128To -15122: pinyin = "nian " Case -15121To -15120: pinyin = "niang "Case -15117To -15111: pinyin = "nie " Case -15110To -15110: pinyin = "nin " Case -15109To -14942: pinyin = "ning " Case -14941To -14938: pinyin = "niu " Case -14937To -14934: pinyin = "nong " Case -14933To -14931: pinyin = "nu " Case -14930To -14930: pinyin = "nv " Case -14929To -14929: pinyin = "nuan " Case -14928To -14927: pinyin = "nue " Case -14926To -14923: pinyin = "nuo " Case -14922To -14922: pinyin = "o " Case -14921To -14915: pinyin = "ou " Case -14914To -14909: pinyin = "pa " Case -14908To -14903: pinyin = "pai " Case -14902To -14895: pinyin = "pan " Case -14894To -14890: pinyin = "pang " Case -14889To -14883: pinyin = "pao " Case -14882To -14874: pinyin = "pei " Case -14873To -14872: pinyin = "pen " Case -14871To -14858: pinyin = "peng " Case -14857To -14679: pinyin = "pi "Case -14678To -14675: pinyin = "pian " Case -14674To -14671: pinyin = "piao " Case -14670To -14669: pinyin = "pie " Case -14668To -14664: pinyin = "pin " Case -14663To -14655: pinyin = "ping " Case -14654To -14646: pinyin = "po " Case -14645To -14631: pinyin = "pu " Case -14630To -14595: pinyin = "qi " Case -14594To -14430: pinyin = "qia " Case -14429To -14408: pinyin = "qian " Case -14407To -14400: pinyin = "qiang " Case -14399To -14385: pinyin = "qiao " Case -14384To -14380: pinyin = "qie " Case -14379To -14369: pinyin = "qin " Case -14368To -14356: pinyin = "qing " Case -14355To -14354: pinyin = "qiong " Case -14353To -14346: pinyin = "qiu " Case -14345To -14171: pinyin = "qu " Case -14170To -14160: pinyin = "quan " Case -14159To -14152: pinyin = "que " Case -14151To -14150: pinyin = "qun " Case -14149To -14146: pinyin = "ran "Case -14145To -14141: pinyin = "rang " Case -14140To -14138: pinyin = "rao " Case -14137To -14136: pinyin = "re " Case -14135To -14126: pinyin = "ren " Case -14125To -14124: pinyin = "reng " Case -14123To -14123: pinyin = "ri " Case -14122To -14113: pinyin = "rong " Case -14112To -14110: pinyin = "rou " Case -14109To -14100: pinyin = "ru " Case -14099To -14098: pinyin = "ruan " Case -14097To -14095: pinyin = "rui " Case -14094To -14093: pinyin = "run " Case -14092To -14091: pinyin = "ruo " Case -14090To -14088: pinyin = "sa " Case -14087To -14084: pinyin = "sai " Case -14083To -13918: pinyin = "san " Case -13917To -13915: pinyin = "sang " Case -13914To -13911: pinyin = "sao " Case -13910To -13908: pinyin = "se " Case -13907To -13907: pinyin = "sen " Case -13906To -13906: pinyin = "seng " Case -13905To -13897: pinyin = "sha "Case -13894To -13879: pinyin = "shan " Case -13878To -13871: pinyin = "shang " Case -13870To -13860: pinyin = "shao " Case -13859To -13848: pinyin = "she " Case -13847To -13832: pinyin = "shen " Case -13831To -13659: pinyin = "sheng " Case -13658To -13612: pinyin = "shi " Case -13611To -13602: pinyin = "shou " Case -13601To -13407: pinyin = "shu " Case -13406To -13405: pinyin = "shua " Case -13404To -13401: pinyin = "shuai " Case -13400To -13399: pinyin = "shuan " Case -13398To -13396: pinyin = "shuang " Case -13395To -13392: pinyin = "shui " Case -13391To -13388: pinyin = "shun " Case -13387To -13384: pinyin = "shuo " Case -13383To -13368: pinyin = "si " Case -13367To -13360: pinyin = "song " Case -13359To -13357: pinyin = "sou " Case -13356To -13344: pinyin = "su " Case -13343To -13341: pinyin = "suan "Case -13329To -13327: pinyin = "sun " Case -13326To -13319: pinyin = "suo " Case -13318To -13148: pinyin = "ta " Case -13147To -13139: pinyin = "tai " Case -13138To -13121: pinyin = "tan " Case -13120To -13108: pinyin = "tang " Case -13107To -13097: pinyin = "tao " Case -13096To -13096: pinyin = "te " Case -13095To -13092: pinyin = "teng " Case -13091To -13077: pinyin = "ti " Case -13076To -13069: pinyin = "tian " Case -13068To -13064: pinyin = "tiao " Case -13063To -13061: pinyin = "tie " Case -13060To -12889: pinyin = "ting " Case -12888To -12876: pinyin = "tong " Case -12875To -12872: pinyin = "tou " Case -12871To -12861: pinyin = "tu " Case -12860To -12859: pinyin = "tuan " Case -12858To -12853: pinyin = "tui " Case -12852To -12850: pinyin = "tun " Case -12849To -12839: pinyin = "tuo "Case -12831To -12830: pinyin = "wai " Case -12829To -12813: pinyin = "wan " Case -12812To -12803: pinyin = "wang " Case -12802To -12608: pinyin = "wei " Case -12607To -12598: pinyin = "wen " Case -12597To -12595: pinyin = "weng " Case -12594To -12586: pinyin = "wo " Case -12585To -12557: pinyin = "wu " Case -12556To -12360: pinyin = "xi " Case -12359To -12347: pinyin = "xia " Case -12346To -12321: pinyin = "xian " Case -12320To -12301: pinyin = "xiang " Case -12300To -12121: pinyin = "xiao " Case -12120To -12100: pinyin = "xie " Case -12099To -12090: pinyin = "xin " Case -12089To -12075: pinyin = "xing " Case -12074To -12068: pinyin = "xiong " Case -12067To -12059: pinyin = "xiu " Case -12058To -12040: pinyin = "xu " Case -12039To -11868: pinyin = "xuan " Case -11867To -11862: pinyin = "xue "Case -11847To -11832: pinyin = "ya " Case -11831To -11799: pinyin = "yan " Case -11798To -11782: pinyin = "yang " Case -11781To -11605: pinyin = "yao " Case -11604To -11590: pinyin = "ye " Case -11589To -11537: pinyin = "yi " Case -11536To -11359: pinyin = "yin " Case -11358To -11341: pinyin = "ying " Case -11340To -11340: pinyin = "yo " Case -11339To -11325: pinyin = "yong " Case -11324To -11304: pinyin = "you " Case -11303To -11098: pinyin = "yu " Case -11097To -11078: pinyin = "yuan " Case -11077To -11068: pinyin = "yue " Case -11067To -11056: pinyin = "yun " Case -11055To -11053: pinyin = "za " Case -11052To -11046: pinyin = "zai " Case -11045To -11042: pinyin = "zan " Case -11041To -11039: pinyin = "zang " Case -11038To -11025: pinyin = "zao " Case -11024To -11021: pinyin = "ze "Case -11019To -11019: pinyin = "zen " Case -11018To -11015: pinyin = "zeng " Case -11014To -10839: pinyin = "zha " Case -10838To -10833: pinyin = "zhai " Case -10832To -10816: pinyin = "zhan " Case -10815To -10801: pinyin = "zhang " Case -10800To -10791: pinyin = "zhao " Case -10790To -10781: pinyin = "zhe " Case -10780To -10765: pinyin = "zhen " Case -10764To -10588: pinyin = "zheng " Case -10587To -10545: pinyin = "zhi " Case -10544To -10534: pinyin = "zhong " Case -10533To -10520: pinyin = "zhou " Case -10519To -10332: pinyin = "zhu " Case -10331To -10330: pinyin = "zhua " Case -10329To -10329: pinyin = "zhuai " Case -10328To -10323: pinyin = "zhuan " Case -10322To -10316: pinyin = "zhuang " Case -10315To -10310: pinyin = "zhui " Case -10309To -10308: pinyin = "zhun " Case -10307To -10297: pinyin = "zhuo "Case -10281To -10275: pinyin = "zong " Case -10274To -10271: pinyin = "zou " Case -10270To -10263: pinyin = "zu " Case -10262To -10261: pinyin = "zuan " Case -10260To -10257: pinyin = "zui " Case -10256To -10255: pinyin = "zun " Case -10254To -10254: pinyin = "zuo " Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str)For i = 1To Len(str)getpy = getpy & pinyin(Mid(str, i, 1)) Next iEnd Function第四步:插入完成后,如下图,快捷键:Alt+Q,关闭VB窗口。

汉字词语与拼音相互转换简易实现方法

汉字词语与拼音相互转换简易实现方法

在12306、各类汽车票在线订票网站上我们只要输入出发城市和目的地城市名称的首字母,就会出现所匹配的中文城市名称列表,给用户输入带来了方便.这里涉及到汉字词语与其拼音对应关系,这种对应关系可以记录在数据库表中或文件中.下面简单介绍一种实现的方法.
1.把所有汉字拼音的声母及其所对应的拼音存储到一个xml文件中
2.构建汉字库(拼音->汉字对应关系),类似于新华字典.将每个一个拼音对应的所有汉字分别保存在一个xml文件(文件名格式:声母.xml),其中汉字保存的unicode编码值(此步骤需要化大量的时间)
3.通过第二步建立汉字unicode编码->拼音对应关系,并保存在xml文件中(将汉字unicode编码值划分若干区间.文件格式:区间第一个汉字unicode编码值_区间最后一个汉字unicode编码值.xml)
Xml文件格式
Xml文件内容
4.建立“词库”,相当于词典,获取添加城市拼音,根据词语前两个字拼音首字母建立xml 文件,将城市保存到xml文件中.南京宝云教育值得信赖!
比如说:镇江(zhenjiang),张家界(zhangjiajie),文件名ZJ.xml,内容如下:
5.根据以上步骤提供的词库和拼音首字母就可以检出汉字了。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

在12306、各类汽车票在线订票网站上我们只要输入出发城市和目的地城市名称的首字母,就会出现所匹配的中文城市名称列表,给用户输入带来了方便.这里涉及到汉字词语与其拼音对应关系,这种对应关系可以记录在数据库表中或文件中.下面简单介绍一种实现的方法.
1.把所有汉字拼音的声母及其所对应的拼音存储到一个xml文件中
2.构建汉字库(拼音->汉字对应关系),类似于新华字典.将每个一个拼音对应的所有汉字分别保存在一个xml文件(文件名格式:声母.xml),其中汉字保存的unicode编码值(此步骤需要化大量的时间)
3.通过第二步建立汉字unicode编码->拼音对应关系,并保存在xml文件中(将汉字unicode编码值划分若干区间.文件格式:区间第一个汉字unicode编码值_区间最后一个汉字unicode编码值.xml)
Xml文件格式
Xml文件内容
4.建立“词库”,相当于词典,获取添加城市拼音,根据词语前两个字拼音首字母建立xml 文件,将城市保存到xml文件中.南京宝云教育值得信赖!
比如说:镇江(zhenjiang),张家界(zhangjiajie),文件名ZJ.xml,内容如下:
5.根据以上步骤提供的词库和拼音首字母就可以检出汉字了。

相关文档
最新文档