code: public void printFeatures(String exportFile, Collection<List<IN>> documents) {
      try {
        PrintWriter pw = IOUtils.getPrintWriter(exportFile);
        for (List<IN> doc:documents) {
          String str = getFeatureString(doc);
          pw.println(str);
        }
        pw.close();
      } catch (IOException ex) {
        throw new RuntimeException(ex);
      }
    }
docs: Output features from a collection of documents to a file
  Format is with one line per token using the following format
  word label feat1 feat2 ...
  (where each space is actually a tab)
  Each document is separated by an empty line
  This format is suitable for modified crfsgd
  @param exportFile file to export the features to
  @param documents input collection of documents