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:11:19 UTC
[jira] [Created] (OPENNLP-650) Parser command-line tool exception
on input line of solely whitespace.
Aaron Binns created OPENNLP-650:
-----------------------------------
Summary: 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}}
{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.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)