jzonthemtn commented on code in PR #1205:
URL: https://github.com/apache/opennlp/pull/1205#discussion_r3778550800


##########
opennlp-core/opennlp-ml/opennlp-ml-commons/src/main/java/opennlp/tools/ml/BeamSearch.java:
##########
@@ -113,10 +177,10 @@ public <T> Sequence[] bestSequences(final int 
numSequences, final T[] sequence,
 
     final CacheState state = threadState.get();
 
-    Queue<Sequence> prev = new PriorityQueue<>(size);
-    Queue<Sequence> next = new PriorityQueue<>(size);
-    Queue<Sequence> tmp;
-    prev.add(new Sequence());
+    Queue<SearchNode> prev = new PriorityQueue<>(size);

Review Comment:
   At some point we should modify `SearchNode`'s `compareTo` to guarantee 
deterministic ordering when two candidate sequences having the same score. I 
suppose that behavior has been around a long time.



-- 
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