Removed deprecated snippet methods in KorapMatch
diff --git a/CHANGES b/CHANGES
index e91ea65..969e440 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
- [cleanup] Major refactoring for new response messages (diewald)
- [cleanup] Removed deprecated error messaging (diewald)
- [cleanup] Removed long-term deprecated methods in KorapResult (diewald)
+ - [cleanup] Removed long-term deprecated methods in KorapMatch (diewald)
- [cleanup] Renamed toJSON->toJsonString (diewald)
- [cleanup] Renamed toJSONnode->toJsonNode (diewald)
- [cleanup] Renamed fromJSON->fromJson (diewald)
diff --git a/src/main/java/de/ids_mannheim/korap/KorapMatch.java b/src/main/java/de/ids_mannheim/korap/KorapMatch.java
index 74a62bc..8697aef 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapMatch.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapMatch.java
@@ -61,7 +61,7 @@
@JsonIgnore
public SearchContext context;
- // Should be deprecated, but used wildly in tests!
+ // Public, while used wildly in tests!
@JsonIgnore
public int startPos, endPos = -1;
@@ -951,10 +951,6 @@
};
};
- @Deprecated
- public String snippetHTML () {
- return this.getSnippetHTML();
- };
@JsonProperty("snippet")
public String getSnippetHTML () {
@@ -1024,11 +1020,6 @@
return (this.snippetHTML = sb.toString());
};
-
- @Deprecated
- public String snippetBrackets () {
- return this.getSnippetBrackets();
- };
@JsonIgnore
public String getSnippetBrackets () {
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
index 2397e82..ba1dd54 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
@@ -66,10 +66,10 @@
assertEquals("totalResults", kr.getTotalResults(), 1);
assertEquals("StartPos (0)", 7, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 9, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "... bcabca[ba]c", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... bcabca[ba]c", kr.getMatch(0).getSnippetBrackets());
assertEquals("SnippetHTML (0)", "<span class=\"context-left\"><span class=\"more\">" +
"</span>bcabca</span><span class=\"match\">ba</span><span class=\"context-right" +
- "\">c</span>", kr.getMatch(0).snippetHTML());
+ "\">c</span>", kr.getMatch(0).getSnippetHTML());
sq = new SpanTermQuery(new Term("base", "s:b"));
kr = ki.search(sq, (short) 10);
@@ -77,19 +77,19 @@
assertEquals("totalResults", kr.getTotalResults(), 3);
assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "a[b]cabcab ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "a[b]cabcab ...", kr.getMatch(0).getSnippetBrackets());
assertEquals("SnippetHTML (0)", "<span class=\"context-left\">a</span><span class=\"match\">" +
"b</span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>",
- kr.getMatch(0).snippetHTML());
+ kr.getMatch(0).getSnippetHTML());
assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
- assertEquals("SnippetBrackets (1)", "abca[b]cabac", kr.getMatch(1).snippetBrackets());
+ assertEquals("SnippetBrackets (1)", "abca[b]cabac", kr.getMatch(1).getSnippetBrackets());
assertEquals("StartPos (2)", 7, kr.getMatch(2).startPos);
assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
- assertEquals("SnippetBrackets (2)", "... bcabca[b]ac", kr.getMatch(2).snippetBrackets());
+ assertEquals("SnippetBrackets (2)", "... bcabca[b]ac", kr.getMatch(2).getSnippetBrackets());
sq = new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")));
kr = ki.search(sq, (short) 10);
@@ -97,18 +97,18 @@
assertEquals("totalResults", kr.getTotalResults(), 3);
assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
- assertEquals("snippetBrackets (0)", "a[{1:b}]cabcab ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("snippetBrackets (0)", "a[{1:b}]cabcab ...", kr.getMatch(0).getSnippetBrackets());
assertEquals("snippetHTML (0)", "<span class=\"context-left\">a</span><span class=\"match\">" +
"<em class=\"class-1 level-0\">b</em></span><span class=\"context-right\">cabcab<span " +
- "class=\"more\"></span></span>", kr.getMatch(0).snippetHTML());
+ "class=\"more\"></span></span>", kr.getMatch(0).getSnippetHTML());
assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
- assertEquals("snippetBrackets (1)", "abca[{1:b}]cabac", kr.getMatch(1).snippetBrackets());
+ assertEquals("snippetBrackets (1)", "abca[{1:b}]cabac", kr.getMatch(1).getSnippetBrackets());
assertEquals("StartPos (2)", 7, kr.getMatch(2).startPos);
assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
- assertEquals("snippetBrackets (2)", "... bcabca[{1:b}]ac", kr.getMatch(2).snippetBrackets());
+ assertEquals("snippetBrackets (2)", "... bcabca[{1:b}]ac", kr.getMatch(2).getSnippetBrackets());
sq = new SpanNextQuery(
@@ -121,16 +121,16 @@
assertEquals("totalResults", kr.getTotalResults(), 3);
assertEquals("StartPos (0)", 0, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "[a{1:b}]cabcab ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "[a{1:b}]cabcab ...", kr.getMatch(0).getSnippetBrackets());
- assertEquals("SnippetHTML (0)", "<span class=\"context-left\"></span><span class=\"match\">a<em class=\"class-1 level-0\">b</em></span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetHTML (0)", "<span class=\"context-left\"></span><span class=\"match\">a<em class=\"class-1 level-0\">b</em></span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>", kr.getMatch(0).getSnippetHTML());
assertEquals("StartPos (1)", 3, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
- assertEquals("SnippetBrackets (1)", "abc[a{1:b}]cabac", kr.getMatch(1).snippetBrackets());
+ assertEquals("SnippetBrackets (1)", "abc[a{1:b}]cabac", kr.getMatch(1).getSnippetBrackets());
assertEquals("StartPos (2)", 6, kr.getMatch(2).startPos);
assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
- assertEquals("SnippetBrackets (2)", "abcabc[a{1:b}]ac", kr.getMatch(2).snippetBrackets());
+ assertEquals("SnippetBrackets (2)", "abcabc[a{1:b}]ac", kr.getMatch(2).getSnippetBrackets());
// abcabcabac
@@ -143,14 +143,14 @@
assertEquals("StartPos (0)", 0, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "[{2:a}{3:b}]cabcab ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "[{2:a}{3:b}]cabcab ...", kr.getMatch(0).getSnippetBrackets());
assertEquals("StartPos (1)", 3, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
- assertEquals("SnippetBrackets (1)", "abc[{2:a}{3:b}]cabac", kr.getMatch(1).snippetBrackets());
+ assertEquals("SnippetBrackets (1)", "abc[{2:a}{3:b}]cabac", kr.getMatch(1).getSnippetBrackets());
assertEquals("StartPos (2)", 6, kr.getMatch(2).startPos);
assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
- assertEquals("SnippetBrackets (2)", "abcabc[{2:a}{3:b}]ac", kr.getMatch(2).snippetBrackets());
+ assertEquals("SnippetBrackets (2)", "abcabc[{2:a}{3:b}]ac", kr.getMatch(2).getSnippetBrackets());
// abcabcabac
sq = new SpanNextQuery(
@@ -165,20 +165,20 @@
kr = ki.search(sq, (short) 10);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "abcabc[a{2:b{1:a}}]c", kr.getMatch(0).snippetBrackets());
- assertEquals("SnippetHTML (0)", "<span class=\"context-left\">abcabc</span><span class=\"match\">a<em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetBrackets (0)", "abcabc[a{2:b{1:a}}]c", kr.getMatch(0).getSnippetBrackets());
+ assertEquals("SnippetHTML (0)", "<span class=\"context-left\">abcabc</span><span class=\"match\">a<em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).getSnippetHTML());
// Offset tokens
kr = ki.search(sq, 0, (short) 10, true, (short) 2, true, (short) 2);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "... bc[a{2:b{1:a}}]c", kr.getMatch(0).snippetBrackets());
- assertEquals("SnippetHTML (0)", "<span class=\"context-left\"><span class=\"more\"></span>bc</span><span class=\"match\">a<em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetBrackets (0)", "... bc[a{2:b{1:a}}]c", kr.getMatch(0).getSnippetBrackets());
+ assertEquals("SnippetHTML (0)", "<span class=\"context-left\"><span class=\"more\"></span>bc</span><span class=\"match\">a<em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).getSnippetHTML());
// Offset Characters
kr = ki.search(sq, 0, (short) 10, false, (short) 2, false, (short) 2);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "... bc[a{2:b{1:a}}]c", kr.getMatch(0).snippetBrackets());
- assertEquals("SnippetHTML (0)", "<span class=\"context-left\"><span class=\"more\"></span>bc</span><span class=\"match\">a<em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetBrackets (0)", "... bc[a{2:b{1:a}}]c", kr.getMatch(0).getSnippetBrackets());
+ assertEquals("SnippetHTML (0)", "<span class=\"context-left\"><span class=\"more\"></span>bc</span><span class=\"match\">a<em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).getSnippetHTML());
// System.err.println(kr.toJSON());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
index 4f73ce3..e201de4 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -103,7 +103,7 @@
KorapMatch km = kr.getMatch(0);
- assertEquals("SnippetBrackets (0)", "... bcabca[{2:b{1:a}}]c", km.snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... bcabca[{2:b{1:a}}]c", km.getSnippetBrackets());
assertEquals("ID (0)", "match-c1!d1-p7-9(2)7-8(1)8-8", km.getID());
};
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
index f2d081e..5894963 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
@@ -73,9 +73,9 @@
assertEquals("totalResults", kr.getTotalResults(), 1);
assertEquals("StartPos (0)", 7, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 9, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "... bcabca[b{1:a}]c", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... bcabca[b{1:a}]c", kr.getMatch(0).getSnippetBrackets());
- assertEquals("Test no 'more' context", "<span class=\"context-left\"><span class=\"more\"></span>bcabca</span><span class=\"match\">b<em class=\"class-1 level-0\">a</em></span><span class=\"context-right\">c</span>", kr.getMatch(0).snippetHTML());
+ assertEquals("Test no 'more' context", "<span class=\"context-left\"><span class=\"more\"></span>bcabca</span><span class=\"match\">b<em class=\"class-1 level-0\">a</em></span><span class=\"context-right\">c</span>", kr.getMatch(0).getSnippetHTML());
sq = new SpanMatchModifyClassQuery(
new SpanNextQuery(
new SpanTermQuery(new Term("base", "s:b")),
@@ -89,7 +89,7 @@
assertEquals("totalResults", kr.getTotalResults(), 1);
assertEquals("StartPos (0)", 8, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 9, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "... cabcab[{1:a}]c", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... cabcab[{1:a}]c", kr.getMatch(0).getSnippetBrackets());
sq = new SpanMatchModifyClassQuery(
new SpanNextQuery(
new SpanClassQuery(new SpanTermQuery(new Term("base", "s:a")), (byte) 2),
@@ -102,20 +102,20 @@
assertEquals("totalResults", kr.getTotalResults(), 3);
assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "a[{3:b}]cabcab ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "a[{3:b}]cabcab ...", kr.getMatch(0).getSnippetBrackets());
- assertEquals("<span class=\"context-left\">a</span><span class=\"match\"><em class=\"class-3 level-0\">b</em></span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>", kr.getMatch(0).snippetHTML());
+ assertEquals("<span class=\"context-left\">a</span><span class=\"match\"><em class=\"class-3 level-0\">b</em></span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>", kr.getMatch(0).getSnippetHTML());
assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
- assertEquals("SnippetBrackets (1)", "abca[{3:b}]cabac", kr.getMatch(1).snippetBrackets());
+ assertEquals("SnippetBrackets (1)", "abca[{3:b}]cabac", kr.getMatch(1).getSnippetBrackets());
- assertEquals("<span class=\"context-left\">abca</span><span class=\"match\"><em class=\"class-3 level-0\">b</em></span><span class=\"context-right\">cabac</span>", kr.getMatch(1).snippetHTML());
+ assertEquals("<span class=\"context-left\">abca</span><span class=\"match\"><em class=\"class-3 level-0\">b</em></span><span class=\"context-right\">cabac</span>", kr.getMatch(1).getSnippetHTML());
assertEquals("StartPos (2)", 7, kr.getMatch(2).startPos);
assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
- assertEquals("SnippetBrackets (2)", "... bcabca[{3:b}]ac", kr.getMatch(2).snippetBrackets());
+ assertEquals("SnippetBrackets (2)", "... bcabca[{3:b}]ac", kr.getMatch(2).getSnippetBrackets());
@@ -133,23 +133,23 @@
kr = ki.search(sq, (short) 10);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "... bcabca[{2:b{1:a}}]c", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... bcabca[{2:b{1:a}}]c", kr.getMatch(0).getSnippetBrackets());
- assertEquals("SnippetHTML (0) 1", "<span class=\"context-left\"><span class=\"more\"></span>bcabca</span><span class=\"match\"><em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetHTML (0) 1", "<span class=\"context-left\"><span class=\"more\"></span>bcabca</span><span class=\"match\"><em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\">c</span>", kr.getMatch(0).getSnippetHTML());
// Offset tokens
kr = ki.search(sq, 0, (short) 10, true, (short) 2, true, (short) 2);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "... ca[{2:b{1:a}}]c", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... ca[{2:b{1:a}}]c", kr.getMatch(0).getSnippetBrackets());
// Offset Characters
kr = ki.search(sq, 0, (short) 10, false, (short) 1, false, (short) 0);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "... a[{2:b{1:a}}] ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... a[{2:b{1:a}}] ...", kr.getMatch(0).getSnippetBrackets());
- assertEquals("SnippetHTML (0) 2", "<span class=\"context-left\"><span class=\"more\"></span>a</span><span class=\"match\"><em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\"><span class=\"more\"></span></span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetHTML (0) 2", "<span class=\"context-left\"><span class=\"more\"></span>a</span><span class=\"match\"><em class=\"class-2 level-0\">b<em class=\"class-1 level-1\">a</em></em></span><span class=\"context-right\"><span class=\"more\"></span></span>", kr.getMatch(0).getSnippetHTML());
sq = new SpanMatchModifyClassQuery(
new SpanClassQuery(
@@ -165,10 +165,10 @@
assertEquals("totalResults", kr.getTotalResults(), 2);
assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 3, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "a[{3:{1:b}{2:c}}]abcaba ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "a[{3:{1:b}{2:c}}]abcaba ...", kr.getMatch(0).getSnippetBrackets());
assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 6, kr.getMatch(1).endPos);
- assertEquals("SnippetBrackets (1)", "abca[{3:{1:b}{2:c}}]abac", kr.getMatch(1).snippetBrackets());
+ assertEquals("SnippetBrackets (1)", "abca[{3:{1:b}{2:c}}]abac", kr.getMatch(1).getSnippetBrackets());
assertEquals("Document count", 1, ki.numberOf("base", "documents"));
assertEquals("Token count", 10, ki.numberOf("base", "t"));
@@ -202,10 +202,10 @@
assertEquals("totalResults", kr.getTotalResults(), 2);
assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
assertEquals("EndPos (0)", 3, kr.getMatch(0).endPos);
- assertEquals("SnippetBrackets (0)", "a[{1:bc}]abcaba ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "a[{1:bc}]abcaba ...", kr.getMatch(0).getSnippetBrackets());
assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
assertEquals("EndPos (1)", 6, kr.getMatch(1).endPos);
- assertEquals("SnippetBrackets (1)", "abca[{1:bc}]abac", kr.getMatch(1).snippetBrackets());
+ assertEquals("SnippetBrackets (1)", "abca[{1:bc}]abac", kr.getMatch(1).getSnippetBrackets());
assertEquals(1, ki.numberOf("base", "documents"));
assertEquals(10, ki.numberOf("base", "t"));
@@ -245,26 +245,26 @@
kr = ki.search(sq, (short) 20);
assertEquals("totalResults", kr.getTotalResults(), 7);
- assertEquals("SnippetBrackets (0)", "<span class=\"context-left\"></span><span class=\"match\">a</span><span class=\"context-right\">bcabca<span class=\"more\"></span></span>", kr.getMatch(0).snippetHTML());
- assertEquals("SnippetBrackets (0)", "[a]bcabca ...", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "<span class=\"context-left\"></span><span class=\"match\">a</span><span class=\"context-right\">bcabca<span class=\"more\"></span></span>", kr.getMatch(0).getSnippetHTML());
+ assertEquals("SnippetBrackets (0)", "[a]bcabca ...", kr.getMatch(0).getSnippetBrackets());
- assertEquals("SnippetBrackets (1)", "ab[c]abcaba ...", kr.getMatch(1).snippetBrackets());
- assertEquals("SnippetBrackets (1)", "<span class=\"context-left\">ab</span><span class=\"match\">c</span><span class=\"context-right\">abcaba<span class=\"more\"></span></span>", kr.getMatch(1).snippetHTML());
+ assertEquals("SnippetBrackets (1)", "ab[c]abcaba ...", kr.getMatch(1).getSnippetBrackets());
+ assertEquals("SnippetBrackets (1)", "<span class=\"context-left\">ab</span><span class=\"match\">c</span><span class=\"context-right\">abcaba<span class=\"more\"></span></span>", kr.getMatch(1).getSnippetHTML());
- assertEquals("SnippetBrackets (6)", "... abcaba[c]", kr.getMatch(6).snippetBrackets());
- assertEquals("SnippetBrackets (6)", "<span class=\"context-left\"><span class=\"more\"></span>abcaba</span><span class=\"match\">c</span><span class=\"context-right\"></span>", kr.getMatch(6).snippetHTML());
+ assertEquals("SnippetBrackets (6)", "... abcaba[c]", kr.getMatch(6).getSnippetBrackets());
+ assertEquals("SnippetBrackets (6)", "<span class=\"context-left\"><span class=\"more\"></span>abcaba</span><span class=\"match\">c</span><span class=\"context-right\"></span>", kr.getMatch(6).getSnippetHTML());
kr = ki.search(sq, 0, (short) 20, true, (short) 0, true, (short) 0);
assertEquals("totalResults", kr.getTotalResults(), 7);
- assertEquals("SnippetBrackets (0)", "[a] ...", kr.getMatch(0).snippetBrackets());
- assertEquals("SnippetHTML (0)", "<span class=\"context-left\"></span><span class=\"match\">a</span><span class=\"context-right\"><span class=\"more\"></span></span>", kr.getMatch(0).snippetHTML());
+ assertEquals("SnippetBrackets (0)", "[a] ...", kr.getMatch(0).getSnippetBrackets());
+ assertEquals("SnippetHTML (0)", "<span class=\"context-left\"></span><span class=\"match\">a</span><span class=\"context-right\"><span class=\"more\"></span></span>", kr.getMatch(0).getSnippetHTML());
- assertEquals("SnippetBrackets (1)", "... [c] ...", kr.getMatch(1).snippetBrackets());
- assertEquals("SnippetHTML (1)", "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\">c</span><span class=\"context-right\"><span class=\"more\"></span></span>", kr.getMatch(1).snippetHTML());
+ assertEquals("SnippetBrackets (1)", "... [c] ...", kr.getMatch(1).getSnippetBrackets());
+ assertEquals("SnippetHTML (1)", "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\">c</span><span class=\"context-right\"><span class=\"more\"></span></span>", kr.getMatch(1).getSnippetHTML());
- assertEquals("SnippetBrackets (6)", "... [c]", kr.getMatch(6).snippetBrackets());
- assertEquals("SnippetBrackets (6)", "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\">c</span><span class=\"context-right\"></span>", kr.getMatch(6).snippetHTML());
+ assertEquals("SnippetBrackets (6)", "... [c]", kr.getMatch(6).getSnippetBrackets());
+ assertEquals("SnippetBrackets (6)", "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\">c</span><span class=\"context-right\"></span>", kr.getMatch(6).getSnippetHTML());
};
@@ -299,7 +299,7 @@
kr = ki.search(sq, 0, (short) 20, true, (short) 2, true, (short) 5);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("SnippetBrackets (0)", "... ca[{1:ba{2:c}}]", kr.getMatch(0).snippetBrackets());
+ assertEquals("SnippetBrackets (0)", "... ca[{1:ba{2:c}}]", kr.getMatch(0).getSnippetBrackets());
};
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
index 618fad1..8f63b62 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
@@ -791,21 +791,21 @@
kr = ki.search(sq, 0, (short) 15, true, (short) 1, true, (short) 1);
assertEquals("totalResults", kr.getTotalResults(), 1);
- assertEquals("... schrie: [\"{3:Das war ich}!\"] und ...",kr.getMatch(0).snippetBrackets());
- assertEquals("<span class=\"context-left\"><span class=\"more\"></span>schrie: </span><span class=\"match\">"<em class=\"class-3 level-0\">Das war ich</em>!"</span><span class=\"context-right\"> und<span class=\"more\"></span></span>",kr.getMatch(0).snippetHTML());
+ assertEquals("... schrie: [\"{3:Das war ich}!\"] und ...",kr.getMatch(0).getSnippetBrackets());
+ assertEquals("<span class=\"context-left\"><span class=\"more\"></span>schrie: </span><span class=\"match\">"<em class=\"class-3 level-0\">Das war ich</em>!"</span><span class=\"context-right\"> und<span class=\"more\"></span></span>",kr.getMatch(0).getSnippetHTML());
kr = ki.search(sq, 0, (short) 15, true, (short) 0, true, (short) 0);
- assertEquals("... [\"{3:Das war ich}!\"] ...",kr.getMatch(0).snippetBrackets());
+ assertEquals("... [\"{3:Das war ich}!\"] ...",kr.getMatch(0).getSnippetBrackets());
assertEquals("totalResults", kr.getTotalResults(), 1);
kr = ki.search(sq, 0, (short) 15, true, (short) 6, true, (short) 6);
- assertEquals("Er schrie: [\"{3:Das war ich}!\"] und ging.",kr.getMatch(0).snippetBrackets());
+ assertEquals("Er schrie: [\"{3:Das war ich}!\"] und ging.",kr.getMatch(0).getSnippetBrackets());
assertEquals("totalResults", kr.getTotalResults(), 1);
kr = ki.search(sq, 0, (short) 15, true, (short) 2, true, (short) 2);
- assertEquals("Er schrie: [\"{3:Das war ich}!\"] und ging ...",kr.getMatch(0).snippetBrackets());
+ assertEquals("Er schrie: [\"{3:Das war ich}!\"] und ging ...",kr.getMatch(0).getSnippetBrackets());
assertEquals("totalResults", kr.getTotalResults(), 1);
@@ -818,7 +818,7 @@
), (byte) 1);
kr = ki.search(sq, (short) 15);
- assertEquals("Er schrie: [\"{1:{2:Das} war ich}!\"] und ging.",kr.getMatch(0).snippetBrackets());
+ assertEquals("Er schrie: [\"{1:{2:Das} war ich}!\"] und ging.",kr.getMatch(0).getSnippetBrackets());
assertEquals("totalResults", kr.getTotalResults(), 1);
sq = new SpanClassQuery(
@@ -830,7 +830,7 @@
), (byte) 1);
kr = ki.search(sq, (short) 15);
- assertEquals("Er schrie: [\"{1:Das {2:war} ich}!\"] und ging.",kr.getMatch(0).snippetBrackets());
+ assertEquals("Er schrie: [\"{1:Das {2:war} ich}!\"] und ging.",kr.getMatch(0).getSnippetBrackets());
assertEquals("totalResults", kr.getTotalResults(), 1);
sq = new SpanClassQuery(
@@ -842,7 +842,7 @@
), (byte) 1);
kr = ki.search(sq, (short) 15);
- assertEquals("Er schrie: [\"{1:Das war {2:ich}}!\"] und ging.",kr.getMatch(0).snippetBrackets());
+ assertEquals("Er schrie: [\"{1:Das war {2:ich}}!\"] und ging.",kr.getMatch(0).getSnippetBrackets());
assertEquals("totalResults", kr.getTotalResults(), 1);
sq = new SpanClassQuery(