in.close();
out.close();
}
private static void toSimp() throws IOException {
ChineseTrans ct = new ChineseTrans();
BufferedReader in = new BufferedReader(new InputStreamReader(
new FileInputStream(infile ), "utf8"));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
simpfile), "utf8"));
String line = null;
int count=0;
while ((line = in.readLine()) != null) {
if(line.length()==0){
}else if(line.startsWith("<doc")){
count++;
}else if(line.startsWith("</doc>")){
count--;
}else{
line = ct.toSimp(line);
}
out.append(line);
out.append("\n");
}
System.out.println(count);