public static void main(String[] args) {

    String dataFileName, modelFileName;
    boolean real = false;
    String type = "maxent";
    int ai = 0;

    if (args.length == 0) {
      usage();
    }

    if (args.length > 0) {
      while (args[ai].startsWith("-")) {
        if (args[ai].equals("-real")) {
          real = true;
        } else if (args[ai].equals("-perceptron")) {
          type = "perceptron";
        } else {
          usage();
        }
        ai++;
      }

      modelFileName = args[ai++];
      dataFileName = args[ai++];

      ModelApplier predictor = null;
      try {
        MaxentModel m = new GenericModelReader(new File(modelFileName)).getModel();
        predictor = new ModelApplier(m);
      } catch (Exception e) {
        e.printStackTrace();
        System.exit(0);
      }

      try {
        EventStream es = new BasicEventStream(new PlainTextByLineDataStream(
            new FileReader(new File(dataFileName))), ",");

        while (es.hasNext())
          predictor.eval(es.next(), real);

        return;
      } catch (Exception e) {
        System.out.println("Unable to read from specified file: "
            + modelFileName);
        System.out.println();
        e.printStackTrace();
      }
    }
  }