krickert commented on code in PR #1003:
URL: https://github.com/apache/opennlp/pull/1003#discussion_r3058808785


##########
opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/lemmatizer/LemmatizerME.java:
##########
@@ -123,8 +132,12 @@ public List<List<String>> lemmatize(List<String> toks, 
List<String> tags) {
    * @return An array of possible lemma classes for each token in {@code toks}.
    */
   public String[] predictSES(String[] toks, String[] tags) {
-    bestSequence = model.bestSequence(toks, new Object[] {tags}, 
contextGenerator, sequenceValidator);
-    List<String> ses = bestSequence.getOutcomes();
+    Sequence seq = model.bestSequence(toks, new Object[] {tags}, 
contextGenerator, sequenceValidator);
+    this.bestSequence = seq; // volatile write for backward-compatible probs() 
access

Review Comment:
   Done. `predictSES()` 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]

Reply via email to