code: public static Map<String, Double> readIdfs(BufferedReader reader, int N) throws IOException {
      HashMap<String, Double> idfs = new HashMap<String, Double>();
      String nextLine;
      while (((nextLine = reader.readLine()) != null)) {
        String[] parts = nextLine.split("\\t+");
        checkArgument(parts.length >= 2);
        Double df = Double.parseDouble(parts[1]);
        idfs.put(parts[0], Math.log(1.0 + N / df)); // idf
      }
      return idfs;
    }
docs: Computes inverse document frequencies as a map of Strings to Doubles from a tab separated file of term document
  frequencies.
  
  @param reader
  the input reader.
  @param N
  the number of documents in the collection.
  @return the inverse document frequencies.
  @throws IOException