WordStatistic.java
package bbb;
import java.io.*;
import java.util.*;
public class Wordstatistic {
Vector<String> allWord,noSameWord;
File file = new File("D:\\t\\english.txt");
Scanner sc = null;
String regex;
Wordstatistic() {
allWord = new Vector<String>();
noSameWord = new Vector<String>();
regex= "[\\s\\d\\p{Punct}]+";
try{ sc = new Scanner(file);
sc.useDelimiter(regex);
}
catch(IOException exp) {
System.out.println(exp.toString());
}
}
void setFileName(String name) {
file = new File(name);
try{ sc = new Scanner(file);
sc.useDelimiter(regex);
}
catch(IOException exp) {
System.out.println(exp.toString());
}
}
public void wordStatistic() {
try{ while(sc.hasNext()){
String w