[ 
https://issues.apache.org/jira/browse/OPENNLP-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027341#comment-13027341
 ] 

Jörn Kottmann commented on OPENNLP-161:
---------------------------------------

There are exactly 6 mandatory arguments and that is why I believe the test 
should be args.length != 6.

> SentenceDetectorEvaluator has incorrect validation for number of command line 
> arguments
> ---------------------------------------------------------------------------------------
>
>                 Key: OPENNLP-161
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-161
>             Project: OpenNLP
>          Issue Type: Bug
>          Components: Sentence Detector
>    Affects Versions: tools-1.5.1-incubating
>            Reporter: Stanislav Peshterliev
>            Priority: Minor
>             Fix For: tools-1.5.1-incubating
>
>
> When I execute
> {code}
> opennlp SentenceDetectorEvaluator -encoding UTF-8 -model pt.sentdetect.model 
> -data pt.sentdetect.test
> {code}
> the result is 
> {code}
> Usage: opennlp SentenceDetectorEvaluator -encoding charset -model model -data 
> testData
> {code}
> 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.
> {code}
>     if (args.length != 4) {
>       System.out.println(getHelp());
>       throw new TerminateToolException(1);
>     }
> {code}
> Actually args.length is 6. Changing the condition to args.length < 6 solves 
> the problem.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to