OPENNLP-982: Allow loading of 1.5.x models

This closes #129


Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo
Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/331e6bd1
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/331e6bd1
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/331e6bd1

Branch: refs/heads/parser_regression
Commit: 331e6bd1bd2486a4162b25b91a163acd35c0a3ba
Parents: 559747a
Author: Jörn Kottmann <[email protected]>
Authored: Fri Feb 17 12:32:11 2017 +0100
Committer: Jörn Kottmann <[email protected]>
Committed: Thu Apr 20 12:40:21 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/opennlp/tools/util/model/BaseModel.java          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/opennlp/blob/331e6bd1/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
----------------------------------------------------------------------
diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java 
b/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
index 20acd9d..f70fb03 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
@@ -416,7 +416,7 @@ public abstract class BaseModel implements 
ArtifactProvider, Serializable {
         // Major and minor version must match, revision might be
         // this check allows for the use of models of n minor release behind 
current minor release
         if (Version.currentVersion().getMajor() != version.getMajor() ||
-            Version.currentVersion().getMinor() - 2 > version.getMinor()) {
+            Version.currentVersion().getMinor() - 3 > version.getMinor()) {
           throw new InvalidFormatException("Model version " + version + " is 
not supported by this ("
               + Version.currentVersion() + ") version of OpenNLP!");
         }

Reply via email to