You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Aaron Binns (JIRA)" <ji...@apache.org> on 2014/02/23 20:13:19 UTC
[jira] [Updated] (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 ]
Aaron Binns updated OPENNLP-650:
--------------------------------
Description:
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.
was:
In the Parser command-line tool, if an input line is comprised of solely whitespace, then you get an array index exception in {{parseLine}}
{code}
String text = sb.substring(0, sb.length() - 1);
{code}
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.
> 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
>
> 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)