I have got a method that reads a file, puts each word into an array of strings and then adds each word to a tree. I want to modify it so that the word is not added to the tree if it contains NON English characters eg spanish etc. I though about the 'contains' method but it doesn't work on the array of type String. How would i do it ?
public void parse(File f) throws Exception {
Node root = new Node('+'); //create a root node
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
String line;
while((line = br.readLine())!=null){
String[] words = line.toLowerCase().split(" ");
for(int i = 0; i < words.length; i++){
addToTree(words[i], root);
}
}//end of while