导入java.util.collections;导入java.util.iterator;导入java.util.linkedhashmap;导入java.util.map; / ** *将汉字转化为全拼 */ public class cntospell1 {私有静态映射<string,integer> spellmap = null; //存放生僻字和其拼音的映射私有静态映射<字符,字符串> unesonwordsmap = null; static {if(spellmap == null){spellmap = collections.synchronizedmap(new linkedhashmap <string,integer>(396)); uncondordsmap = collections.synchronizedmap(new linkedhashmap <targe,string>(200)); } initialize(); inituncommonwords(); } private cntospell1(){} / ** *初始化 * / private static void initialize(){spellmap.put(“'a”,-20319); spellmap.put(“'ai”,-20317); spellmap.put(“'an”,-20304); spellmap.put(“'ang”,-20295); spellmap.put(“'ao”,-20292); spellmap.put(“ ba”,-20283); spellmap.put(“ bai”,-20265); spellmap.put(“ ban”,-20257); spellmap.put(“ bang”,-20242); spellmap.put(“ bao”,-20230); spellmap.put(“ bei”,-20051); spellmap.put(“ ben”,-20036); spellmap.put(“ beng”,-20032); spellmap.put(“ bi”,-20026); spellmap.put(“ bian”,-20002); spellmap.put(“ biao”,-19990); spellmap.put(“ bie”,-19986); spellmap.put(“ bin”,-19982); spellmap.put(“ bing”,-19976); spellmap.put(“ bo”,-19805); spellmap.put(“ bu”,-19784); spellmap.put(“ ca”,-19775); spellmap.put(“ CAI”,-19774); spellmap.put(“ can”,-19763); spellmap.put(“ cang”,-19756); spellmap.put(“ cao”,-19751); spellmap.put(“ CE”,-19746); spellmap.put(“ ceng”,-19741); spellmap.put(“ cha”,-19739); spellmap.put(“ chai”,-19728); spellmap.put(“ chan”,-19725); spellmap.put(“ chang”,-19715); spellmap.put(“ chao”,-19540); spellmap.put(“ che”,-19531); spellmap.put(“ chen”,-19525); SpellMap.put(“ Cheng”,-19515); spellmap.put(“ chi”,-19500); spellmap.put(“ chong”,-19484); spellmap.put(“ chou”,-19479); spellmap.put(“ chu”,-19467); spellmap.put(“ chuai”,-19289); spellmap.put(“ chuan”,-19288); spellmap.put(“ chuang”,-19281); spellmap.put(“ chui”,-19275); spellmap.put(“ chun”,-19270); spellmap.put(“ chuo”,-19263); spellmap.put(“ CI”,-19261); spellmap.put(“ cong”,-19249); spellmap.put(“ cou”,-19243); spellmap.put(“ Cu”,-19242); SpellMap.put(“ Cuan”,-19238); spellmap.put(“ cui”,-19235); spellmap.put(“ cun”,-19227); spellmap.put(“ cuo”,-19224); spellmap.put(“ da”,-19218); spellmap.put(“ dai”,-19212); spellmap.put(“ dan”,-19038); spellmap.put(“ dang”,-19023); spellmap.put(“ dao”,-19018); spellmap.put(“ de”,-19006); spellmap.put(“ deng”,-19003); spellmap.put(“ di”,-18996); spellmap.put(“ dian”,-18977); spellmap.put(“ diao”,-18961); spellmap.put(“ die”,-18952); spellmap.put(“ ding”,-18783); spellmap.put(“ diu”,-18774); spellmap.put(“ dong”,-18773); spellmap.put(“ dou”,-18763); spellmap.put(“ du”,-18756); spellmap.put(“ duan”,-18741); SpellMap.put(“ DUI”,-18735); spellmap.put(“ dun”,-18731); spellmap.put(“ Duo”,-18722); spellmap.put(“'e”,-18710); spellmap.put(“'en”,-18697); spellmap.put(“'er”,-18696); spellmap.put(“ fa”,-18526); spellmap.put(“ fan”,-18518); spellmap.put(“ fang”,-18501); spellmap.put(“ fei”,-18490); spellmap.put(“ fen”,-18478); spellmap.put(“ feng”,-18463); spellmap.put(“ fo”,-18448); spellmap.put(“ fou”,-18447); spellmap.put(“ fu”,-18446); spellmap.put(“ ga”,-18239); spellmap.put(“ gai”,-18237); spellmap.put(“ gan”,-18231); spellmap.put(“帮”,-18220); spellmap.put(“ gao”,-18211); SpellMap.put(“ GE”,-18201); spellmap.put(“ gei”,-18184); spellmap.put(“ gen”,-18183); spellmap.put(“ geng”,-18181); spellmap.put(“锣”,-18012); spellmap.put(“ gou”,-17997); spellmap.put(“ gu”,-17988); spellmap.put(“ gua”,-17970); spellmap.put(“ guai”,-17964); SpellMap.put(“ Guan”,-17961); spellmap.put(“ guang”,-17950); spellmap.put(“ gui”,-17947); spellmap.put(“枪”,-17931); SpellMap.put(“ Guo”,-17928); spellmap.put(“ ha”,-17922); spellmap.put(“ hai”,-17759); spellmap.put(“ han”,-17752); spellmap.put(“ hang”,-17733); spellmap.put(“ hao”,-17730); spellmap.put(“ He”,-17721); spellmap.put(“ hei”,-17703); spellmap.put(“ Hen”,-17701); spellmap.put(“ heng”,-17697); spellmap.put(“ hong”,-17692); spellmap.put(“ hou”,-17683); spellmap.put(“ hu”,-17676); spellmap.put(“ hua”,-17496); spellmap.put(“ huai”,-17487); spellmap.put(“ huan”,-17482); spellmap.put(“黄”,-17468); spellmap.put(“ hui”,-17454); spellmap.put(“ hun”,-17433); spellmap.put(“ huo”,-17427); spellmap.put(“ ji”,-17417); spellmap.put(“ jia”,-17202); SpellMap.put(“ Jian”,-17185); spellmap.put(“江”,-16983); spellmap.put(“ jiao”,-16970); spellmap.put(“ jie”,-16942); spellmap.put(“ jin”,-16915); spellmap.put(“ jing”,-16733); spellmap.put(“ jiong”,-16708); spellmap.put(“ jiu”,-16706); spellmap.put(“ JU”,-16689); spellmap.put(“ juan”,-16664); spellmap.put(“ jue”,-16657); spellmap.put(“ jun”,-16647); spellmap.put(“ ka”,-16474); spellmap.put(“ kai”,-16470); spellmap.put(“ kan”,-16465); spellmap.put(“ kang”,-16459); SpellMap.put(“ Kao”,-16452); spellmap.put(“ ke”,-16448); spellmap.put(“ ken”,-16433); spellmap.put(“ keng”,-16429); SpellMap.put(“ Kong”,-16427); spellmap.put(“ kou”,-16423); spellmap.put(“ ku”,-16419); spellmap.put(“ kua”,-16412); spellmap.put(“ kuai”,-16407); spellmap.put(“ kuan”,-16403); spellmap.put(“ kuang”,-16401); spellmap.put(“ kui”,-16393); spellmap.put(“ kun”,-16220); spellmap.put(“ kuo”,-16216); spellmap.put(“ la”,-16212); spellmap.put(“ lai”,-16205); spellmap.put(“ lan”,-16202); spellmap.put(“ lang”,-16187); spellmap.put(“老挝”,-16180); spellmap.put(“ le”,-16171); spellmap.put(“ lei”,-16169); spellmap.put(“ leng”,-16158); spellmap.put(“ li”,-16155); spellmap.put(“ lia”,-15959); spellmap.put(“ lian”,-15958); SpellMap.put(“ Liang”,-15944); spellmap.put(“ liao”,-15933); spellmap.put(“ lie”,-15920); spellmap.put(“ lin”,-15915); spellmap.put(“ ling”,-15903); spellmap.put(“ liu”,-15889); spellmap.put(“长”,-15878); spellmap.put(“ lou”,-15707); spellmap.put(“ lu”,-15701); spellmap.put(“ lv”,-15681); spellmap.put(“ luan”,-15667); spellmap.put(“ lue”,-15661); spellmap.put(“ lun”,-15659); spellmap.put(“ luo”,-15652); spellmap.put(“ ma”,-15640); spellmap.put(“ mai”,-15631); spellmap.put(“男人”,-15625); spellmap.put(“ mang”,-15454); spellmap.put(“毛”,-15448); spellmap.put(“ me”,-15436); spellmap.put(“ mei”,-15435); spellmap.put(“男人”,-15419); SpellMap.put(“ Meng”,-15416); spellmap.put(“ mi”,-15408); spellmap.put(“ mian”,-15394); spellmap.put(“ miao”,-15385); spellmap.put(“ mie”,-15377); spellmap.put(“ min”,-15375); spellmap.put(“ ming”,-15369); spellmap.put(“ miu”,-15363); spellmap.put(“ mo”,-15362); spellmap.put(“ MOU”,-15183); spellmap.put(“ mu”,-15180); spellmap.put(“ na”,-15165); spellmap.put(“ nai”,-15158); spellmap.put(“ nan”,-15153); spellmap.put(“ nang”,-15150); spellmap.put(“ nao”,-15149); spellmap.put(“ NE”,-15144); spellmap.put(“ nei”,-15143); spellmap.put(“ nen”,-15141); spellmap.put(“ neng”,-15140); spellmap.put(“ ni”,-15139); spellmap.put(“ nian”,-15128); spellmap.put(“ niang”,-15121); spellmap.put(“ niao”,-15119); spellmap.put(“ nie”,-15117); spellmap.put(“ nin”,-15110); spellmap.put(“ ning”,-15109); spellmap.put(“ niu”,-14941); spellmap.put(“ nong”,-14937); spellmap.put(“ nu”,-14933); spellmap.put(“ NV”,-14930); spellmap.put(“ nuan”,-14929); spellmap.put(“ nue”,-14928); spellmap.put(“ nuo”,-14926); spellmap.put(“'o”,-14922); spellmap.put(“'ou”,-14921); spellmap.put(“ pa”,-14914); spellmap.put(“ pai”,-14908); spellmap.put(“ pan”,-14902); spellmap.put(“ pang”,-14894); spellmap.put(“ pao”,-14889); spellmap.put(“ pei”,-14882); spellmap.put(“笔”,-14873); spellmap.put(“ peng”,-14871); spellmap.put(“ pi”,-14857); spellmap.put(“ pian”,-14678); spellmap.put(“ piao”,-14674); spellmap.put(“ pie”,-14670); spellmap.put(“ pin”,-14668); spellmap.put(“ ping”,-14663); spellmap.put(“ po”,-14654); spellmap.put(“ pu”,-14645); spellmap.put(“ Qi”,-14630); spellmap.put(“ qia”,-14594); SpellMap.put(“ Qian”,-14429); spellmap.put(“ Qiang”,-14407); spellmap.put(“ qiao”,-14399); spellmap.put(“ qie”,-14384); spellmap.put(“ QIN”,-14379); spellmap.put(“ Qing”,-14368); SpellMap.put(“ Qiong”,-14355); spellmap.put(“ qiu”,-14353); spellmap.put(“ qu”,-14345); spellmap.put(“ quan”,-14170); spellmap.put(“ que”,-14159); spellmap.put(“ qun”,-14151); spellmap.put(“ ran”,-14149); spellmap.put(“ rang”,-14145); spellmap.put(“ rao”,-14140); spellmap.put(“ re”,-14137); spellmap.put(“ ren”,-14135); spellmap.put(“ reng”,-14125); spellmap.put(“ ri”,-14123); spellmap.put(“ rong”,-14122); spellmap.put(“ rou”,-14112); spellmap.put(“ ru”,-14109); spellmap.put(“ ruan”,-14099); spellmap.put(“ rui”,-14097); spellmap.put(“运行”,-14094); spellmap.put(“ ruo”,-14092); spellmap.put(“ sa”,-14090); spellmap.put(“ sai”,-14087); spellmap.put(“ san”,-14083); spellmap.put(“ sang”,-13917); spellmap.put(“ sao”,-13914); spellmap.put(“ se”,-13910); spellmap.put(“ sen”,-13907); spellmap.put(“ seng”,-13906); spellmap.put(“ sha”,-13905); spellmap.put(“ shai”,-13896); spellmap.put(“ shan”,-13894); spellmap.put(“ shang”,-13878); spellmap.put(“ shao”,-13870); spellmap.put(“她”,-13859); spellmap.put(“沉”,-13847); SpellMap.put(“ Sheng”,-13831); spellmap.put(“ shi”,-13658); spellmap.put(“ shou”,-13611); spellmap.put(“ shu”,-13601); spellmap.put(“ shua”,-13406); spellmap.put(“ shuai”,-13404); spellmap.put(“ shuan”,-13400); spellmap.put(“ shuang”,-13398); spellmap.put(“ shui”,-13395); spellmap.put(“ shun”,-13391); spellmap.put(“ shuo”,-13387); spellmap.put(“ si”,-13383); spellmap.put(“歌曲”,-13367); spellmap.put(“ sou”,-13359); spellmap.put(“ su”,-13356); spellmap.put(“ suan”,-13343); spellmap.put(“ sui”,-13340); spellmap.put(“ sun”,-13329); spellmap.put(“ suo”,-13326); spellmap.put(“ ta”,-13318); spellmap.put(“ tai”,-13147); spellmap.put(“ tan”,-13138); SpellMap.put(“ Tang”,-13120); spellmap.put(“ tao”,-13107); spellmap.put(“ TE”,-13096); spellmap.put(“ teng”,-13095); spellmap.put(“ ti”,-13091); spellmap.put(“ tian”,-13076); spellmap.put(“ tiao”,-13068); spellmap.put(“ tie”,-13063); spellmap.put(“ ting”,-13060); spellmap.put(“ tong”,-12888); spellmap.put(“ tou”,-12875); spellmap.put(“ tu”,-12871); spellmap.put(“ tuan”,-12860); spellmap.put(“ tui”,-12858); spellmap.put(“ tun”,-12852); spellmap.put(“ tuo”,-12849); spellmap.put(“ wa”,-12838); spellmap.put(“ wai”,-12831); spellmap.put(“ wan”,-12829); spellmap.put(“王”,-12812); spellmap.put(“ wei”,-12802); spellmap.put(“ wen”,-12607); spellmap.put(“ weng”,-12597); spellmap.put(“ wo”,-12594); spellmap.put(“ Wu”,-12585); spellmap.put(“ xi”,-12556); spellmap.put(“ xia”,-12359); spellmap.put(“ xian”,-12346); spellmap.put(“ xiang”,-12320); spellmap.put(“ xiao”,-12300); spellmap.put(“ xie”,-12120); spellmap.put(“ xin”,-12099); SpellMap.put(“ Xing”,-12089); spellmap.put(“ xiong”,-12074); spellmap.put(“ xiu”,-12067); SpellMap.put(“ Xu”,-12058); SpellMap.put(“ Xuan”,-12039); SpellMap.put(“ Xue”,-11867); spellmap.put(“ xun”,-11861); spellmap.put(“ ya”,-11847); spellmap.put(“ yan”,-11831); spellmap.put(“ yang”,-11798); spellmap.put(“ yao”,-11781); spellmap.put(“ ye”,-11604); spellmap.put(“ yi”,-11589); spellmap.put(“ yin”,-11536); spellmap.put(“ ying”,-11358); spellmap.put(“ yo”,-11340); spellmap.put(“ yong”,-11339); spellmap.put(“ you”,-11324); spellmap.put(“ yu”,-11303); spellmap.put(“ yuan”,-11097); spellmap.put(“ yue”,-11077); spellmap.put(“ yun”,-11067); spellmap.put(“ za”,-11055); spellmap.put(“ zai”,-11052); spellmap.put(“ zan”,-11045); spellmap.put(“ zang”,-11041); spellmap.put(“ zao”,-11038); spellmap.put(“ ze”,-11024); spellmap.put(“ Zei”,-11020); SpellMap.put(“ Zen”,-11019); spellmap.put(“ Zeng”,-11018); spellmap.put(“ zha”,-11014); spellmap.put(“ zhai”,-10838); spellmap.put(“ zhan”,-10832); SpellMap.put(“ Zhang”,-10815); spellmap.put(“ Zhao”,-10800); spellmap.put(“ zhe”,-10790); spellmap.put(“ zhen”,-10780); SpellMap.put(“ Zheng”,-10764); spellmap.put(“ Zhi”,-10587); SpellMap.put(“ Zhong”,-10544); spellmap.put(“周”,-10533); SpellMap.put(“ Zhu”,-10519); SpellMap.put(“ Zhua”,-10331); spellmap.put(“ zhuai”,-10329); spellmap.put(“ Zhuan”,-10328); spellmap.put(“ Zhuang”,-10322); SpellMap.put(“ Zhui”,-10315); spellmap.put(“ Zhun”,-10309); SpellMap.put(“ Zhuo”,-10307); spellmap.put(“ zi”,-10296); spellmap.put(“ Zong”,-10281); spellmap.put(“ zou”,-10274); spellmap.put(“ zu”,-10270); SpellMap.put(“ Zuan”,-10262); SpellMap.put(“ Zui”,-10260); spellmap.put(“ zun”,-10256); spellmap.put(“ Zuo”,-10254); } /** *添加生僻字 * @param cnword生僻字 * @param spell生僻字的拼音,如果拼音以a,o,e,e开头安('an) */ public static void penuncommonword(char cnword,string spell){uncomonwordsmap.put(cnword,spell); } / ** *初始化生僻字 * / private static void inituncommonwords(){putuncommonword('','ao'); putuncommonword('灞',“ ba”); putuncommonword('',“ ben”); putuncommonword('',“ biao”); putuncommonword('',“ biao”); putuncommonword('杈',“ cha”); putuncommonword('',“ chen”); putuncommonword('',“ cheng”); putuncommonword('魑',“ chi”); putuncommonword('',“ chong”); putuncommonword('',“ chong”); putuncommonword('',“ cu”); putuncommonword('毳',“ cui”); putuncommonword('',“ fang”); putuncommonword('沣',“ feng”); putuncommonword('',“ gou”); putuncommonword('焓',“ han”); putuncommonword('',“ han”); putuncommonword('晗',“ han”); putuncommonword('',“ han”); putuncommonword('翮',“他”); putuncommonword('',“ he”); putuncommonword('',“ huan”); putuncommonword('',“ hui”); putuncommonword('',“ jie”); putuncommonword('',“ jing”); putuncommonword('',“ jing”); putuncommonword('',“ jing”); putuncommonword('',“ kun”); putuncommonword('琨',“ kun”); putuncommonword('',“ kun”); putuncommonword('骊',“ li”); putuncommonword('鎏',“ liu”); putuncommonword('',““男人”); putuncommonword('',“ mei”); putuncommonword('淼',“ miao”); putuncommonword('',“ nan”); putuncommonword('',“ nan”); putuncommonword('宁',“ ning”); putuncommonword('',“ ning”); putuncommonword('',“ pa”); putuncommonword('',“ pi”); putuncommonword('',“ qian”); putuncommonword('',“ QIN”); putuncommonword('',“ qing”); putuncommonword('',“ qing”); putuncommonword('',“ qing”); putuncommonword('',“ qing”); putuncommonword('',“ qing”); putuncommonword('悫',“ que”); putuncommonword('',“ que”); putuncommonword('',“ rong”); putuncommonword('',“ shen”); putuncommonword('',“ shen”); putuncommonword('',“ shen”); putuncommonword('',“ sheng”); putuncommonword('',“ sheng”); putuncommonword('晟',“ sheng”); putuncommonword('',“ sheng”); putuncommonword('眚',“ sheng”); putuncommonword('',“ sheng”); putuncommonword('',“ sheng”); putuncommonword('',“ sheng”); putuncommonword('',“ sheng”); putuncommonword('',“ shi”); putuncommonword('',“ su”); putuncommonword('',“ tao”); putuncommonword('',“ tian”); putuncommonword('同',“ tong”); putuncommonword('',“ wei”); putuncommonword('炜',“ wei”); putuncommonword('玮',“ wei”); putuncommonword('',“ wu”); putuncommonword('邬',“ wu”); putuncommonword('',“ xi”); putuncommonword('',“ xian”); putuncommonword('',“ xiao”); putuncommonword('',“ xiao”); putuncommonword('筱',“ xiao”); putuncommonword('勰',“ xie”); putuncommonword('忻',“ xin”); putuncommonword('庥',“ xiu”); putuncommonword('',“ xu”); putuncommonword('',“ xu”); putuncommonword('',“ xu”); putuncommonword('',“ xuan”); putuncommonword('煊',“ xuan”); putuncommonword('',“ xuan”); putuncommonword('',“ xuan”); putuncommonword('暄',“ xuan”); putuncommonword('娅',“ ya”); putuncommonword('琰',“ yan”); putuncommonword('妍',“ yan”); putuncommonword('焱',“ yan”); putuncommonword('',“ yang”); putuncommonword('',“ yang”); putuncommonword('',“ yang”); putuncommonword('',“ yao”); putuncommonword('',“ yao”); putuncommonword('怡',“ yi”); putuncommonword('',“ yi”); putuncommonword('',“ yi”); putuncommonword('',“ yi”); putuncommonword('瑛',“ ying”); putuncommonword('',“ ying”); putuncommonword('',“ ying”); putuncommonword('',“ ying”); putuncommonword('滢',“ ying”); putuncommonword('',“ ying”); putuncommonword('莜',“ you”); putuncommonword('昱',“ yu”); putuncommonword('',“ yun”); putuncommonword('',“ zhe”); putuncommonword('',“ zhe”); putuncommonword('',“ zhi”); } /***获得单个汉字的ASCII。 * @param cn汉字字符 * @return汉字对应的aScii,错误时返回0 */ public static int getCnascii(char cn){byte [bytes bytes =(string.valueof(cn)).getBytes(); if(bytes == null || bytes.length == 0 || bytes.length> 2){//错误返回0; } if(bytes.length == 1){//返回字节[0]; } if(bytes.length == 2){//中文字符int hightbyte = 256 + bytes [0]; int lowByte = 256 +字节[1];返回(256 * Hightbyte + Lowbyte)-256 * 256; //返回ASCII}返回0; //错误} /** *根据ASCII码到spellmap中查找对应的拼音 * @param ascii ascii * @return ascii对应的拼音,如果aScii对应的字符为单字符,则返回对应的单字符,则返回对应的单字符splymap中没找到对应的拼音,则返回空字符串(“”), */ public static String getspellbyAscii(int ascii){if(ascii> 0 && ascii <160){/////////////////- valueof((char)ascii); } if(ascii <-20319 || ascii> -10247){//不知道的字符返回“”; }字符串咒语= null; //密钥整数asciirang; // value string spellprevious = null; //用来保存上次轮循环的键int acciirangprevious = -20319; //用来保存上一次循环的值(iterator it = spellmap.keyset()。iterator(); it.hasnext();){spell =(string)it.next(); //拼音asciirang = spellmap.get(spell); //拼音的ascii if(asciirang!= null){if(ascii> = asciirangprevious && ascii <asciirang){//区间找到,返回对应的拼音,返回对应的拼音返回(spellprevious == null)?咒语:拼写; } else {spellprevious = spell; asciirangprevious = asciirang; } } } 返回 ””; } /** *获取字符串的全拼或首拼,是汉字则转化为对应的拼音或拼音首字母,其它字符不进行转换 * @param cnstr要获取全拼或首拼的字符串 * @param唯一的firstspell是否只获取首拼,true时,只获取首拼,false时,获取全拼 * @return string cnstr cnstr cnstr cnstr cnstr为null时,返回(字符串cnstr,boolean hellyfirstspell){if(cnstr == null){return“”; } char [] chars = cnstr.trim()。tochararray(); StringBuffer SB = new StringBuffer(); for(int i = 0,len = chars.length; i <len; i ++){int ascii = getCnascii(chars [i]); if(ascii == 0){//如果获取汉字的ASCII出错,则不进行转换sb.append(chars [i]); } else {string spell = getspellbyascii(ascii); //根据ascii取拼音if(spell == null || spell.length()== 0){//如果根据ac ascii取拼音没取到,则到生僻字映射中取spell = unesonwordsmap.get(chars [chars [chars [chars [chars [chars for)我]); } if(spell == null || spell.length()== 0){//如果没有取到对应的拼音,则不做转换} else {if(bellyfirstspell){sb.append(spell.startswith(“''”)?spell.substring(1,2):spell.substring(0,1)); } else {sb.append(Spell); }}}} // for return SB.ToString(); } public static void main(string [] args){string [] s = {“获取汉字全拼和首拼测试”,“这是一个测试”,“ a,b; c [d]”,',“点。“,”,“ 圆角数字123,特殊符号・¥% - ……”,“:繁体字:西安”,“西安”,“山”}; for(int i = 0; i <s.length; i ++){long l1 = system.currentTimeMillis(); system.out.println(s [i] +“的全拼:” + getSpell(s [i],false)); system.out.println(s [i] +“的首拼:” + getSpell(s [i],true)); system.out.println(“获取全拼和首拼共用了”+(system.currenttimemillis() - l1)+“毫秒/n”); }}}}