This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch opennlp-2.x
in repository https://gitbox.apache.org/repos/asf/opennlp.git


The following commit(s) were added to refs/heads/opennlp-2.x by this push:
     new 799969af OPENNLP-53: Fix compile error in Parse.createFromTokens() on 
2.x                      The cherry-pick of 35227c72 referenced Parser.INC_NODE 
/ Parser.TOK_NODE, which exist on main (where Parser was moved to opennlp-api 
as an interface declaring these constants) but not on the 2.x branch. Use 
AbstractBottomUpParser.INC_NODE / TOK_NODE instead, consistent with the rest of 
the 2.x parser code.
799969af is described below

commit 799969aff306574be0c4968fbf49244421d7c62f
Author: Richard Zowalla <[email protected]>
AuthorDate: Wed Apr 15 10:53:01 2026 +0200

    OPENNLP-53: Fix compile error in Parse.createFromTokens() on 2.x            
          The cherry-pick of 35227c72 referenced Parser.INC_NODE / 
Parser.TOK_NODE, which exist on main (where Parser was moved to opennlp-api as 
an interface declaring these constants) but not on the 2.x branch. Use 
AbstractBottomUpParser.INC_NODE / TOK_NODE instead, consistent with the rest of 
the 2.x parser code.
---
 opennlp-tools/src/main/java/opennlp/tools/parser/Parse.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opennlp-tools/src/main/java/opennlp/tools/parser/Parse.java 
b/opennlp-tools/src/main/java/opennlp/tools/parser/Parse.java
index cb40c1a9..80b613f6 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/parser/Parse.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/parser/Parse.java
@@ -831,11 +831,11 @@ public class Parse implements Cloneable, 
Comparable<Parse> {
     String text = String.join(" ", tokens);
     final Parse p = new Parse(text,
         new Span(0, text.length()),
-        Parser.INC_NODE, 0, 0);
+        AbstractBottomUpParser.INC_NODE, 0, 0);
     int start = 0;
     for (int i = 0; i < tokens.length; i++) {
       p.insert(new Parse(text, new Span(start, start + tokens[i].length()),
-          Parser.TOK_NODE, 0, i));
+          AbstractBottomUpParser.TOK_NODE, 0, i));
       start += tokens[i].length() + 1;
     }
     return p;

Reply via email to