/ictclas4j/src/org/ictclas4j/test/ExportGBK.java

http://ictclas4j.googlecode.com/ · Java · 32 lines · 25 code · 7 blank · 0 comment · 2 complexity · af1f4a2f504cb8612c0830f914e83b35 MD5 · raw file

  1. package org.ictclas4j.test;
  2. import java.io.IOException;
  3. import com.gftech.util.GFFile;
  4. import com.gftech.util.GFString;
  5. public class ExportGBK {
  6. public static void main(String[] args) {
  7. String rs="";
  8. for(int i=0x8140,j=1;i<=0xfefe;i++,j++)
  9. {
  10. byte[] bs=new byte[2];
  11. bs[0]=(byte)((i&0xFF00)>>8);
  12. bs[1]=(byte)(i&0xFF);
  13. rs+="0x"+GFString.bytes2hex(bs)+":"+new String(bs)+" ";
  14. if(j%10==0){
  15. try {
  16. System.out.println(rs);
  17. GFFile.writeTxtFile("gbk.txt",rs,true);
  18. rs="";
  19. } catch (IOException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
  24. }
  25. }