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/8e610f18
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/8e610f18
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/8e610f18

Branch: refs/heads/OPENNLP-778
Commit: 8e610f183caf1829337559e63a68c6a7d4f1ba05
Parents: 33871c3
Author: Jörn Kottmann <[email protected]>
Authored: Fri Feb 17 12:32:11 2017 +0100
Committer: Jörn Kottmann <[email protected]>
Committed: Fri Feb 17 13:43:39 2017 +0100

----------------------------------------------------------------------
 .../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/8e610f18/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