You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Joern Kottmann (JIRA)" <ji...@apache.org> on 2014/02/24 10:00:36 UTC

[jira] [Resolved] (OPENNLP-650) Parser command-line tool exception on input line of solely whitespace.

     [ https://issues.apache.org/jira/browse/OPENNLP-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joern Kottmann resolved OPENNLP-650.
------------------------------------

    Resolution: Fixed

> Parser command-line tool exception on input line of solely whitespace.
> ----------------------------------------------------------------------
>
>                 Key: OPENNLP-650
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-650
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Parser
>    Affects Versions: tools-1.5.3
>            Reporter: Aaron Binns
>            Assignee: Joern Kottmann
>             Fix For: 1.6.0
>
>
> In the Parser command-line tool, if an input line is comprised of solely whitespace, then you get an array index exception in parseLine
>     String text = sb.substring(0, sb.length() - 1);
> because the whitespace doesn't produce any tokens thus sb.length() is 0, and you wind up with an end position of -1.
> Simple solution is to .trim() the input string in ParserTool.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)