Make match expansion configurable (#150)
Change-Id: Ie4eb9098f6e7352918e1fd0d3bf74615d3508e7e
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 1bf2677..97aa429 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -30,6 +30,7 @@
import de.ids_mannheim.korap.response.Result;
import de.ids_mannheim.korap.response.match.MatchIdentifier;
import de.ids_mannheim.korap.response.match.PosIdentifier;
+import de.ids_mannheim.korap.util.KrillProperties;
import de.ids_mannheim.korap.util.QueryException;
@RunWith(JUnit4.class)
@@ -1219,6 +1220,8 @@
@Test
public void indexCorolaTokensBugReplicated () throws IOException, QueryException {
+ KrillProperties.matchExpansionIncludeContextSize=false;
+
KrillIndex ki = new KrillIndex();
ki.addDoc(getClass().getResourceAsStream("/others/corola-bug.json"), false);
@@ -1239,7 +1242,7 @@
String str = km.getSnippetBrackets();
assertTrue(str.contains("[<!>{drukola/l:au:a}"));
- assertFalse(str.contains("<!>]"));
+ assertTrue(str.contains("<!>]"));
km = ki.getMatchInfo("match-Corola-blog/BlogPost/370281_a_371610-p50-51", "tokens", null, null,false, false, true);
@@ -1247,6 +1250,8 @@
str = km.getSnippetBrackets();
assertTrue(str.contains("[<!>{d"));
assertTrue(str.contains("a}<!>]"));
+
+ KrillProperties.matchExpansionIncludeContextSize=true;
};
diff --git a/src/test/resources/krill.properties b/src/test/resources/krill.properties
index 3714c0c..fc26a13 100644
--- a/src/test/resources/krill.properties
+++ b/src/test/resources/krill.properties
@@ -6,5 +6,6 @@
krill.namedVC = queries/collections/named-vcs/
krill.test = true
+krill.match.expansion.includeContextSize = true
krill.match.max.token=50
krill.context.max.token=25