cn.com.cjf.impl.ChineseJFImpl Maven / Gradle / Ivy
package cn.com.cjf.impl;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import cn.com.cjf.ChineseJF;
import cn.com.cjf.config.LoadConfig;
import cn.com.cjf.entity.Char;
import cn.com.cjf.utils.CharFilter;
import cn.com.cjf.utils.IOUtil;
/**
* ChineseJF?ӿڵ?һ??????ʵ??
*
* @author saiya [email protected]
* @lastEdit 2008-10-28
*
*/
public class ChineseJFImpl implements ChineseJF{
/**
* ????-???? ӳ??????
*/
public static Char[] charMapList_Jan2Fan=null;
/**
* ????-???? ӳ??????
*/
public static Char[] charMapList_Fan2Jan=null;
public boolean initialized(){
if(charMapList_Jan2Fan!=null && charMapList_Fan2Jan!=null){
return true;
}
return false;
}
public void init(){
if(this.initialized()==false){
try {
charMapList_Jan2Fan = LoadConfig.getInstance().loadJFmapUTF8();
charMapList_Fan2Jan = LoadConfig.getInstance().loadFJmapUTF8();
} catch (IOException e) {
charMapList_Jan2Fan = null;
charMapList_Fan2Jan = null;
throw new RuntimeException(e);
}
}
}
public String chineseFan2Jan(String fanText){
if(fanText==null){
return null;
}
if(this.initialized()==false){
this.init();
}
StringBuffer sb = new StringBuffer();
int textSize=fanText.length();
for(int index=0 ; index
© 2015 - 2025 Weber Informatics LLC | Privacy Policy