fangfangli / cleartk

Automatically exported from code.google.com/p/cleartk
0 stars 0 forks source link

org.cleartk.classifier.mallet.factory needs some arg4j love #284

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I present for your consideration:

      for (int i = 0; i < args.length; i += 2) {
        String optionName = args[i];
        String optionValue = args[i + 1];
        if (optionName.equals("--depthLimited"))
          trainer.setDepthLimited(Boolean.parseBoolean(optionValue));
        else if (optionName.equals("--doPruning"))
          trainer.setDoPruning(Boolean.parseBoolean(optionValue));
        else if (optionName.equals("--maxDepth"))
          trainer.setMaxDepth(Integer.parseInt(optionValue));
        else if (optionName.equals("--minNumInsts"))
          trainer.setMinNumInsts(Integer.parseInt(optionValue));
        else
          throw new IllegalArgumentException(String.format(
              "the argument %1$s is invalid.  ",
              optionName) + getUsageMessage());
      }

Need I say more?

P.S. We should document these options somewhere at the same time.

Original issue reported on code.google.com by steven.b...@gmail.com on 12 Feb 2012 at 5:29

GoogleCodeExporter commented 9 years ago

Original comment by steven.b...@gmail.com on 24 Jul 2012 at 5:41

GoogleCodeExporter commented 9 years ago

Original comment by steven.b...@gmail.com on 24 Jul 2012 at 6:36