/**
* CnToSpell.java
* @author sunlifei
* 时间:2011-8-16 15:42:53
*/
package com.bhne.web.util;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;
/**
* 功能:将汉字转化为拼音
* @author sunlifei
* 时间: 2011-8-16 15:42:53
*/
public class CnToSpell {
private static LinkedHashMap spellMap = null;
static{
if(spellMap == null){
spellMap = new LinkedHashMap(400);
}
initialize();
}
@SuppressWarnings("unchecked")
private static void spellPut(String spell,int ascii){
spellMap.put(spell,new Integer(ascii));
}
private static void initialize(){
spellPut("a", -20317);
spellPut("ai", -20304);
spellPut("an", -20295);
spellPut("ang", -20292);
spellPut("ao", -20283);
spellPut("ba", -20265);
spellPut("bai", -20257);
spellPut("ban", -20242);
spellPut("bang", -20230);
spellPut("bao", -20051);
spellPut("bei", -20036);
spellPut("ben", -20032);
spellPut("beng", -20026);
posted on 2011-08-17 10:07 墙头草 阅读(304) 评论(0) 编辑 收藏