最近有些人需要
移动英汉通词库格式,希望为其增加词库,fengbin哥最近也比较忙,现奉上我写的解词库的
程序,完全个人写的原始版(最近我快要考试了,没有时间加工),没有什么注释,但相信会对大家有所帮助。期待着词库管理器早日出炉,造福广大机油:)
package untitled3;
import java.io.*;
import java.lang.String.*;
/**
*
Title:
*
Description:
*
Copyright: Copyright (c) 2002
*
Company: ZBJZWD
* @author wersdfxcv
* @version 0.1beta
*/
class Untitled1
{
static int zero=0;
public static void main(String[] args) throws IOException
{
OutputStream f4 = new FileOutputStream ("/Output");
f4.close() ;
long j;
//string s;
long count=64;
while (count<=2563300)
{
j=s(count);
while (j!=0 && j>64)
{j=s(j); }
/*if (count==23572)
{
System.out.println("j:"+j);
}*/
if ((j<16) && (j!=0))
{
//System.out.println("x1"+j);
for (long bset=0;bset
);}
for (int i=0;i<=17;i++)
{
if (b==0x0)
{
zero++;
if (i>14) zero--;
}
if (zero==3) { f2.write(b,0,i);return 0;}
}
/*if (b[13]=='n'&& b[12]=='i' && b[11]=='v')
{f2.write(255);f2.write(255);f2.write(255);
f2.write(b[15]);f2.write(b[16]);f2.write(b[17]);
System.out.println("first: "+zero);
System.out.println((b[15]+b[16]*256+(b[17]%16)*65536)*18+2563318);
}
*/
f2.write(b,0,14);
f1.close();
f2.close();
//System.out.println(b[15]) ;
//System.out.println(b[16]) ;
//System.out.println(b[17]) ;
//System.out.println((b[16]+b[17]*256+(b[18]%16)*65536)*18+2563317);
return ((b[15]>=0?b[15]
256+b[15]))+(b[16]>=0?b[16]
256+b[16]))*256+((b[17]>=0?b[17]
256+b[17]))%16)*65536)*18+2563318;
}
else
{
if (b[16]==0x1)
{
//System.out.println("in"+zero);
//System.out.println(b[0]);
long re=b[17]-1;
while (true)
{
//if (offset==2565622){System.out.println("zero:"+ zero); }
for (int i=0;i<=17;i++)
{
if (b==0x0)
{
zero++;
if (b[16]==0x1 && i>16) zero--;
}
if (zero==3)
{
f2.write(b,0,i);
f1.close();
f2.close();
return re;
}
}
if (b[16]==0x1)
{
f2.write(b,0,16);
if (b[17]>=2) f1.skip(18*(b[17]-1));
f1.read(b);
/*if (offset==2603314)
{
System.out.println("1234");
//System.out.println(b[0]);
//System.out.println(b[1]);
System.out.println(re);
}*/
// re=b[17]-1;
}
else
{
f2.write(b,0,18);
f1.close();
f2.close();
return 0;
}
}
}
else
{
//System.out.println("123: "+b[16]) ;
for (int i=0;i<=17;i++)
{
if (b==0x0)
{
zero++;
//if (b[16]==0x1 && i>16) zero--;
}
if (zero==3)
{
//System.out.println((char)b[i-1]) ;
//f2.write(255);
f2.write(b,0,i);
f1.close();
f2.close();
return 0;
}
}
f2.write(b,0,18);
f1.close();
f2.close();
return 0;
}
}
// System.out.println ("error");
// return -1;
}
}