Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-161

SentenceDetectorEvaluator has incorrect validation for number of command line arguments

    XMLWordPrintableJSON

Details

    Description

      When I execute

      opennlp SentenceDetectorEvaluator -encoding UTF-8 -model pt.sentdetect.model -data pt.sentdetect.test
      

      the result is

      Usage: opennlp SentenceDetectorEvaluator -encoding charset -model model -data testData
      

      I got the usage message although the right number of arguments. After short investigation I have found out that in the class SentenceDetectorEvaluatorTool, the validation for number of arguments is incorrect.

          if (args.length != 4) {
            System.out.println(getHelp());
            throw new TerminateToolException(1);
          }
      

      Actually args.length is 6. Changing the condition to args.length < 6 solves the problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stanvp Stanislav Peshterliev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: