You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jz...@apache.org on 2021/06/23 12:35:51 UTC
[opennlp] branch master updated: OPENNLP-1330 Fix Parser top "k"
parses (#392)
This is an automated email from the ASF dual-hosted git repository.
jzemerick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/opennlp.git
The following commit(s) were added to refs/heads/master by this push:
new ae83790 OPENNLP-1330 Fix Parser top "k" parses (#392)
ae83790 is described below
commit ae83790b905829478a7292a98ad8fb4cd52fc459
Author: Eric Ihli <er...@gmail.com>
AuthorDate: Wed Jun 23 07:35:44 2021 -0500
OPENNLP-1330 Fix Parser top "k" parses (#392)
Co-authored-by: Eric Ihli <ei...@owoga.com>
---
.../src/main/java/opennlp/tools/parser/AbstractBottomUpParser.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opennlp-tools/src/main/java/opennlp/tools/parser/AbstractBottomUpParser.java b/opennlp-tools/src/main/java/opennlp/tools/parser/AbstractBottomUpParser.java
index fcec973..bcec9dd 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/parser/AbstractBottomUpParser.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/parser/AbstractBottomUpParser.java
@@ -358,7 +358,7 @@ public abstract class AbstractBottomUpParser implements Parser {
else {
List<Parse> topParses = new ArrayList<>(numParses);
while (!completeParses.isEmpty() && topParses.size() < numParses) {
- Parse tp = completeParses.last();
+ Parse tp = completeParses.first();
completeParses.remove(tp);
topParses.add(tp);
//parses.remove(tp);