[
https://issues.apache.org/jira/browse/OPENNLP-1949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Wiesner updated OPENNLP-1949:
------------------------------------
Summary: End ADSentenceStream at end of file inside an open sentence (was:
ADSentenceStream.read() loops forever on an empty sentence at end of file)
> End ADSentenceStream at end of file inside an open sentence
> -----------------------------------------------------------
>
> Key: OPENNLP-1949
> URL: https://issues.apache.org/jira/browse/OPENNLP-1949
> Project: OpenNLP
> Issue Type: Bug
> Affects Versions: 2.5.12, 3.0.0-M6
> Reporter: Richard Zowalla
> Assignee: Kristian Rickert
> Priority: Minor
> Fix For: 3.0.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {{ADSentenceStream.read\(\)}} \(lines 481\-531\): at EOF with
> {{sentenceStarted == true}} and an empty buffer, neither branch returns, so
> the {{while \(true\)}} loop calls {{samples.read\(\)}} forever.
> _Repro:_
> {code:java}
> new ADSentenceStream\(ObjectStreamUtils.createObjectStream\(""\)\).read\(\);
> // never returns
> {code}
> Verified: still running after 3 s.
> A truncated or damaged Arvores Deitadas file hangs training instead of
> failing.
> _Fix:_ return {{null}} \(or throw {{InvalidFormatException}} naming the
> unclosed sentence\) when EOF is reached with an empty started sentence, and
> add a test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)