docs: public void serializeTextClassifier(String serializePath) {
      System.err.print("Serializing Text classifier to " + serializePath + "...");
      try {
        PrintWriter pw = new PrintWriter(new GZIPOutputStream(new FileOutputStream(serializePath)));
  
        pw.printf("labelIndices.length=\t%d\n", labelIndices.length);
        for (int i = 0; i < labelIndices.length; i++) {
          pw.printf("labelIndices[%d].size()=\t%d\n", i, labelIndices[i].size());
          for (int j = 0; j < labelIndices[i].size(); j++) {
            int[] label = labelIndices[i].get(j).getLabel();
            List<Integer> list = new ArrayList<Integer>();
            for (int l : label) {
              list.add(l);
            }
            pw.printf("%d\t%s\n", j, StringUtils.join(list, " "));
          }
        }
  
        pw.printf("classIndex.size()=\t%d\n", classIndex.size());
        for (int i = 0; i < classIndex.size(); i++) {
          pw.printf("%d\t%s\n", i, classIndex.get(i));
        }
        // pw.printf("</classIndex>\n");
  
        pw.printf("featureIndex.size()=\t%d\n", featureIndex.size());
        for (int i = 0; i < featureIndex.size(); i++) {
          pw.printf("%d\t%s\n", i, featureIndex.get(i));
        }
        // pw.printf("</featureIndex>\n");
  
        pw.println("<flags>");
        pw.print(flags.toString());
        pw.println("</flags>");
  
        pw.printf("<featureFactory> %s </featureFactory>\n", featureFactory.getClass().getName());
  
        pw.printf("<windowSize> %d </windowSize>\n", windowSize);
  
        pw.printf("weights.length=\t%d\n", weights.length);
        for (double[] ws : weights) {
          ArrayList<Double> list = new ArrayList<Double>();
          for (double w : ws) {
            list.add(w);
          }
          pw.printf("%d\t%s\n", ws.length, StringUtils.join(list, " "));
        }
  
        pw.close();
        System.err.println("done.");
  
      } catch (Exception e) {
        System.err.println("Failed");
        e.printStackTrace();
        // don't actually exit in case they're testing too
        // System.exit(1);
      }
    }