docs: public static void main(String[] args) throws Exception {
      StringUtils.printErrInvocationString("CRFClassifier", args);
  
      Properties props = StringUtils.argsToProperties(args);
      CRFClassifier<CoreLabel> crf = new CRFClassifier<CoreLabel>(props);
      String testFile = crf.flags.testFile;
      String textFile = crf.flags.textFile;
      String loadPath = crf.flags.loadClassifier;
      String loadTextPath = crf.flags.loadTextClassifier;
      String serializeTo = crf.flags.serializeTo;
      String serializeToText = crf.flags.serializeToText;
  
      if (loadPath != null) {
        crf.loadClassifierNoExceptions(loadPath, props);
      } else if (loadTextPath != null) {
        System.err.println("Warning: this is now only tested for Chinese Segmenter");
        System.err.println("(Sun Dec 23 00:59:39 2007) (pichuan)");
        try {
          crf.loadTextClassifier(loadTextPath, props);
          // System.err.println("DEBUG: out from crf.loadTextClassifier");
        } catch (Exception e) {
          throw new RuntimeException("error loading " + loadTextPath, e);
        }
      } else if (crf.flags.loadJarClassifier != null) {
        crf.loadJarClassifier(crf.flags.loadJarClassifier, props);
      } else if (crf.flags.trainFile != null || crf.flags.trainFileList != null) {
        crf.train();
      } else {
        crf.loadDefaultClassifier();
      }
  
      // System.err.println("Using " + crf.flags.featureFactory);
      // System.err.println("Using " +
      // StringUtils.getShortClassName(crf.readerAndWriter));
  
      if (serializeTo != null) {
        crf.serializeClassifier(serializeTo);
      }
  
      if (serializeToText != null) {
        crf.serializeTextClassifier(serializeToText);
      }
  
      if (testFile != null) {
        DocumentReaderAndWriter<CoreLabel> readerAndWriter = crf.makeReaderAndWriter();
        if (crf.flags.searchGraphPrefix != null) {
          crf.classifyAndWriteViterbiSearchGraph(testFile, crf.flags.searchGraphPrefix, crf.makeReaderAndWriter());
        } else if (crf.flags.printFirstOrderProbs) {
          crf.printFirstOrderProbs(testFile, readerAndWriter);
        } else if (crf.flags.printProbs) {
          crf.printProbs(testFile, readerAndWriter);
        } else if (crf.flags.useKBest) {
          int k = crf.flags.kBest;
          crf.classifyAndWriteAnswersKBest(testFile, k, readerAndWriter);
        } else if (crf.flags.printLabelValue) {
          crf.printLabelInformation(testFile, readerAndWriter);
        } else {
          crf.classifyAndWriteAnswers(testFile, readerAndWriter);
        }
      }
  
      if (textFile != null) {
        crf.classifyAndWriteAnswers(textFile);
      }
  
      if (crf.flags.readStdin) {
        crf.classifyStdin();
      }
    }