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 2022/10/26 19:25:10 UTC

[opennlp] branch master updated: OPENNLP-1392: Changing conditional to be for version 1.x to fix 2.x POS models. (#429)

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 6c9e604e OPENNLP-1392: Changing conditional to be for version 1.x to fix 2.x POS models. (#429)
6c9e604e is described below

commit 6c9e604e74c941935a3c11f9ba91a7c0f8e1ec4c
Author: Jeff Zemerick <13...@users.noreply.github.com>
AuthorDate: Wed Oct 26 15:25:03 2022 -0400

    OPENNLP-1392: Changing conditional to be for version 1.x to fix 2.x POS models. (#429)
---
 opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerFactory.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerFactory.java b/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerFactory.java
index 52941fe6..501f9f6c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerFactory.java
@@ -274,8 +274,9 @@ public class POSTaggerFactory extends BaseToolFactory {
       Properties manifest = (Properties) artifactProvider.getArtifact("manifest.properties");
 
       String version = manifest.getProperty("OpenNLP-Version");
+      Version v = Version.parse(version);
 
-      if (Version.parse(version).getMinor() < 8) {
+      if (v.getMajor() == 1 && v.getMinor() < 8) {
         return new DefaultPOSContextGenerator(cacheSize, getDictionary());
       }
     }