用Java转化汉字为拼音全拼

王朝java/jsp·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

package com.easydozer.commons.util;

import Java.util.Iterator;

import java.util.LinkedHashMap;

import java.util.Set;

/**

* <pre>汉字转化为全拼</pre>

* <BR><DL><DT><B>JDK版本:</B></DT><BR><DD>1.4</DD></DL>

* @author 谢计生

* @version 1.0

* @see

* @since 1.0

*/

public class CnToSpell

{

private static LinkedHashMap spellMap = null;

static

{

if(spellMap == null){

spellMap = new LinkedHashMap(400);

}

initialize();

System.out.println("Chinese transfer Spell Done.");

}

private CnToSpell()

{

}

private static void spellPut(String spell,int ascii)

{

spellMap.put(spell,new Integer(ascii));

}

private static void initialize()

{

spellPut("a", -20319);

spellPut("ai", -20317);

spellPut("an", -20304);

spellPut("ang", -20295);

spellPut("ao", -20292);

spellPut("ba", -20283);

spellPut("bai", -20265);

spellPut("ban", -20257);

spellPut("bang", -20242);

spellPut("bao", -20230);

spellPut("bei", -20051);

spellPut("ben", -20036);

spellPut("beng", -20032);

spellPut("bi", -20026);

spellPut("bian", -20002);

spellPut("biao", -19990);

spellPut("bie", -19986);

spellPut("bin", -19982);

spellPut("bing", -19976);

spellPut("bo", -19805);

spellPut("bu", -19784);

spellPut("ca", -19775);

spellPut("cai", -19774);

spellPut("can", -19763);

spellPut("cang", -19756);

spellPut("cao", -19751);

spellPut("ce", -19746);

spellPut("ceng", -19741);

spellPut("cha", -19739);

spellPut("chai", -19728);

spellPut("chan", -19725);

spellPut("chang", -19715);

spellPut("chao", -19540);

spellPut("che", -19531);

spellPut("chen", -19525);

spellPut("cheng", -19515);

spellPut("chi", -19500);

spellPut("chong", -19484);

spellPut("chou", -19479);

spellPut("chu", -19467);

spellPut("chuai", -19289);

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航