Richard Zowalla created OPENNLP-1952:
----------------------------------------
Summary: ConlluStream NPE for a multiword token range without its
word lines
Key: OPENNLP-1952
URL: https://issues.apache.org/jira/browse/OPENNLP-1952
Project: OpenNLP
Issue Type: Bug
Reporter: Richard Zowalla
{{ConlluStream.postProcessContractions}}, lines 174/178/186:
{code:java}
int contractionIndex = index.get\(contractionId\);
expandedParts.add\(lines.get\(index.get\(id\)\)\);
{code}
A sentence with a range line {{1\-2}} but no word line {{2}} \(a damaged or
hand\-edited treebank\) unboxes {{null}} and throws NPE instead of
{{InvalidFormatException}}.
_Fix:_ check that every id in the range exists, throw
{{InvalidFormatException}} naming the missing id, and add a test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)