commit | 439eae8e12737d49c05ff12af602dc3be50a6638 | [log] [tgz] |
---|---|---|
author | Nils Diewald <nils@diewald-online.de> | Tue Jul 15 18:35:34 2014 +0000 |
committer | Nils Diewald <nils@diewald-online.de> | Tue Jul 15 18:35:34 2014 +0000 |
tree | 4f425039f389755d6c7f0f1ba1e23308ae9814f9 | |
parent | c0cab879bec69da081432585f7d1125c2c41a299 [diff] |
Fix comparison contract bug (not tested)
diff --git a/src/main/java/de/ids_mannheim/korap/KorapMatch.java b/src/main/java/de/ids_mannheim/korap/KorapMatch.java index 0e81695..993912c 100644 --- a/src/main/java/de/ids_mannheim/korap/KorapMatch.java +++ b/src/main/java/de/ids_mannheim/korap/KorapMatch.java
@@ -770,8 +770,12 @@ } else if (arg0[0] == arg1[0]) { // Check endpositions - if (arg0[1] > arg1[1]) + if (arg0[1] > arg1[1]) { return -1; + } + else if (arg0[1] == arg1[1]) { + return 0; + } return 1; }; return -1; @@ -790,8 +794,12 @@ } else if (arg0[1] == arg1[1]) { // Check start positions - if (arg0[0] < arg1[0]) + if (arg0[0] < arg1[0]) { return 1; + } + else if (arg0[0] == arg1[0]) { + return 0; + }; return -1; }; return -1;
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java index a2a3c72..6eaf44c 100644 --- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java +++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -177,7 +177,6 @@ // Start creating query /* - ks = new KorapSearch(kq.tag("xip/c:NPA")); ks.setCount(1); ks.setCutOff(true);