krickert commented on code in PR #1003:
URL: https://github.com/apache/opennlp/pull/1003#discussion_r3058824917
##########
opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/postag/POSTaggerME.java:
##########
@@ -188,8 +217,12 @@ public String[] tag(String[] sentence) {
*/
@Override
public String[] tag(String[] sentence, Object[] additionalContext) {
- bestSequence = model.bestSequence(sentence, additionalContext, cg,
sequenceValidator);
- final List<String> t = bestSequence.getOutcomes();
+ Sequence seq = model.bestSequence(sentence, additionalContext, cg,
sequenceValidator);
+ this.bestSequence = seq; // volatile write for backward-compatible probs()
access
Review Comment:
Done. `tag(...)` now assigns `bestSequence` only after the null check.
Pushed in 6673a0a.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]