code: public static Set<String> readStopwords(BufferedReader reader) throws IOException {
      HashSet<String> words = new HashSet<String>();
      String nextLine;
      while (((nextLine = reader.readLine()) != null)) {
        words.add(nextLine.trim().toLowerCase());
      }
      return words;
    }
docs: Read stopwords in memory from a file, one per line. Stopwords are converted to lowercase when read.
  
  @param reader
  the input reader.
  @return a set of stopwords.
  @throws IOException