我有一个读取文件的方法,将每个单词放入字符串数组中,然后将每个单词添加到树中。我想修改它,以便如果单词包含非英文字符(例如西班牙语等),则不会将其添加到树中。我虽然关于“包含”方法,但它不适用于字符串类型的数组。我该怎么做?
    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