resoure service error
diff --git a/src/test/java/CollectionQueryBuilderTest.java b/src/test/java/CollectionQueryBuilderTest.java
index f895962..78739c7 100644
--- a/src/test/java/CollectionQueryBuilderTest.java
+++ b/src/test/java/CollectionQueryBuilderTest.java
@@ -1,5 +1,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import de.ids_mannheim.korap.query.serialize.QuerySerializer;
+import de.ids_mannheim.korap.resources.KustvaktResource;
+import de.ids_mannheim.korap.resources.VirtualCollection;
import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
import de.ids_mannheim.korap.utils.JsonUtils;
import org.junit.Ignore;
@@ -143,7 +145,7 @@
b.setBaseQuery(check.toJSON());
b.with("textClass=freizeit");
- JsonNode res = (JsonNode) b.rebaseCollection();
+ JsonNode res = (JsonNode) b.rebaseCollection(null);
assertNotNull(res);
assertEquals("koral:docGroup", res.at("/collection/@type").asText());
assertEquals("operation:and", res.at("/collection/operation").asText());
@@ -176,7 +178,7 @@
c.setBaseQuery(b.toJSON());
c.with("corpusSigle=BRZ13");
- JsonNode base = (JsonNode) c.rebaseCollection();
+ JsonNode base = (JsonNode) c.rebaseCollection(null);
assertNotNull(base);
assertEquals(base.at("/collection/@type").asText(), "koral:docGroup");
assertEquals(base.at("/collection/operands/1/@type").asText(),
@@ -201,7 +203,7 @@
KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
test.with("textClass=wissenschaft | textClass=politik");
- JsonNode node = (JsonNode) test.rebaseCollection();
+ JsonNode node = (JsonNode) test.rebaseCollection(null);
node = b.mergeWith(node);
assertNotNull(node);
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
@@ -227,7 +229,7 @@
KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
test.setBaseQuery(check.toJSON());
test.or().with("textClass=wissenschaft | textClass=politik");
- JsonNode node = (JsonNode) test.rebaseCollection();
+ JsonNode node = (JsonNode) test.rebaseCollection(null);
assertNotNull(node);
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
assertEquals("operation:or", node.at("/collection/operation").asText());
@@ -246,7 +248,7 @@
KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
test.setBaseQuery(check.toJSON());
test.and().with("textClass=wissenschaft | textClass=politik");
- JsonNode node = (JsonNode) test.rebaseCollection();
+ JsonNode node = (JsonNode) test.rebaseCollection(null);
assertNotNull(node);
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
assertEquals("operation:and", node.at("/collection/operation").asText());
@@ -265,7 +267,7 @@
KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
test.setBaseQuery(check.toJSON());
test.with("textClass=wissenschaft | textClass=politik");
- JsonNode node = (JsonNode) test.rebaseCollection();
+ JsonNode node = (JsonNode) test.rebaseCollection(null);
assertNotNull(node);
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
assertEquals("operation:and", node.at("/collection/operation").asText());
@@ -274,25 +276,92 @@
@Test
- @Ignore
- public void testMergeOperator () {
- String coll = "corpusSigle=WPD";
- String query = "[base=Haus]";
- QuerySerializer check = new QuerySerializer();
- check.setQuery(query, "poliqarp");
- check.setCollection(coll);
+ public void testCollectionMergeWithFromResource () {
+ KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
+ builder.with("textClass=politik & corpusSigle=WPD");
+ KustvaktResource resource = new VirtualCollection();
+ resource.setName("collection_1");
+ String json = builder.toJSON();
+ resource.setFields(json);
- KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
- b.setBaseQuery(check.toJSON());
+ assertEquals(json, resource.getStringData());
+ builder = new KoralCollectionQueryBuilder();
+ builder.setBaseQuery(resource.getData());
+ builder.or().with("pubPlace=Mannheim");
+ }
- KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
- test.with("textClass=wissenschaft | textClass=politik");
- JsonNode node = (JsonNode) test.rebaseCollection();
- node = b.mergeWith(node);
+
+ @Test
+ public void testCollectionMergeFromQuerySerializer () {
+ QuerySerializer s = new QuerySerializer();
+ s.setQuery("[base=Haus]", "poliqarp");
+ KoralCollectionQueryBuilder total = new KoralCollectionQueryBuilder();
+ total.setBaseQuery(s.toJSON());
+
+
+ KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
+ builder.with("textClass=politik & corpusSigle=WPD");
+ KustvaktResource resource = new VirtualCollection();
+ resource.setName("collection_1");
+ String json = builder.toJSON();
+ resource.setFields(json);
+ // operator is irrelevant here
+ JsonNode node = total.or().mergeWith(resource.getData());
assertNotNull(node);
assertEquals("koral:docGroup", node.at("/collection/@type").asText());
assertEquals("operation:and", node.at("/collection/operation").asText());
- assertEquals(2, node.at("/collection/operands").size());
+ assertEquals("textClass", node.at("/collection/operands/0/key")
+ .asText());
+ assertEquals("corpusSigle", node.at("/collection/operands/1/key")
+ .asText());
}
+
+ @Test
+ public void testBaseCollectionNull () {
+ // base is missing collection segment
+ QuerySerializer s = new QuerySerializer();
+ s.setQuery("[base=Haus]", "poliqarp");
+
+ KoralCollectionQueryBuilder total = new KoralCollectionQueryBuilder();
+ total.setBaseQuery(s.toJSON());
+
+ KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
+ builder.with("textClass=politik & corpusSigle=WPD");
+ JsonNode node = total.and().mergeWith(
+ (JsonNode) builder.rebaseCollection(null));
+
+ assertNotNull(node);
+ assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+ assertEquals("operation:and", node.at("/collection/operation").asText());
+ assertEquals("koral:doc", node.at("/collection/operands/0/@type")
+ .asText());
+ assertEquals("koral:doc", node.at("/collection/operands/1/@type")
+ .asText());
+ assertEquals("textClass", node.at("/collection/operands/0/key")
+ .asText());
+ assertEquals("corpusSigle", node.at("/collection/operands/1/key")
+ .asText());
+ }
+
+
+ @Test
+ public void testMergeCollectionNull () {
+ // merge json is missing collection segment
+ QuerySerializer s = new QuerySerializer();
+ s.setQuery("[base=Haus]", "poliqarp");
+ s.setCollection("textClass=wissenschaft");
+
+ KoralCollectionQueryBuilder total = new KoralCollectionQueryBuilder();
+ total.setBaseQuery(s.toJSON());
+
+ KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
+ JsonNode node = total.and().mergeWith(
+ (JsonNode) builder.rebaseCollection(null));
+ assertNotNull(node);
+ assertEquals("koral:doc", node.at("/collection/@type").asText());
+ assertEquals("textClass", node.at("/collection/key").asText());
+ }
+
+
}
diff --git a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
index c11b7e3..5070bfe 100644
--- a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
@@ -1,11 +1,21 @@
package de.ids_mannheim.korap.config;
import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
import de.ids_mannheim.korap.utils.ServiceInfo;
import de.ids_mannheim.korap.utils.TimeUtils;
import de.ids_mannheim.korap.web.service.BootableBeanInterface;
+import de.ids_mannheim.korap.web.service.full.AdminService;
+import org.apache.lucene.util.IOUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.junit.Assert;
import org.junit.Test;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -18,6 +28,22 @@
*/
public class ConfigTest extends BeanConfigTest {
+
+ @Test
+ public void testAdminHash () throws IOException, KustvaktException,
+ NoSuchAlgorithmException {
+ AdminSetup setup = AdminSetup.getInstance();
+ String hash = setup.getHash();
+ File f = new File("./admin_token");
+ FileInputStream stream = new FileInputStream(f);
+ String token = IOUtil.toString(stream);
+ assertNotEquals("", hash);
+ assertNotEquals("", token);
+ EncryptionIface crypto = helper().getContext().getEncryption();
+ assertTrue(crypto.checkHash(token, hash));
+ }
+
+
@Test
public void testServiceInfo () {
String version = ServiceInfo.getInfo().getVersion();
diff --git a/src/test/java/de/ids_mannheim/korap/config/StringUtilsTest.java b/src/test/java/de/ids_mannheim/korap/config/StringUtilsTest.java
new file mode 100644
index 0000000..c77184c
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/config/StringUtilsTest.java
@@ -0,0 +1,26 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.utils.StringUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by hanl on 29.05.16.
+ */
+public class StringUtilsTest {
+
+ @Test
+ public void testTextIToDoc () {
+ String textSigle = "WPD_AAA.02439";
+ String docSigle = "WPD_AAA";
+ assertEquals(docSigle, StringUtils.getDocSigle(textSigle));
+ assertEquals(docSigle, StringUtils.getDocSigle(docSigle));
+ }
+
+
+ @Test
+ public void testSQLRegexBuild () {
+
+ }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index 2c36b66..b51e0b3 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -124,7 +124,7 @@
try {
String hash = ((EncryptionIface) getBean(ContextHolder.KUSTVAKT_ENCRYPTION))
- .produceSecureHash(password);
+ .secureHash(password);
m.put(Attributes.PASSWORD, hash);
}
catch (NoSuchAlgorithmException | UnsupportedEncodingException
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestVariables.java b/src/test/java/de/ids_mannheim/korap/config/TestVariables.java
new file mode 100644
index 0000000..1e157a5
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/config/TestVariables.java
@@ -0,0 +1,473 @@
+package de.ids_mannheim.korap.config;
+
+/**
+ * Created by hanl on 30.05.16.
+ */
+public class TestVariables {
+
+ public static final String SIMPLE_ADD_QUERY = "[pos=ADJA]";
+
+ public static final String RESULT = "{\n"
+ + "\t\"@context\": \"http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld\",\n"
+ + "\t\"meta\": {\n"
+ + "\t\t\"count\": 25,\n"
+ + "\t\t\"startIndex\": 0,\n"
+ + "\t\t\"timeout\": 120000,\n"
+ + "\t\t\"context\": {\n"
+ + "\t\t\t\"left\": [\"token\", 6],\n"
+ + "\t\t\t\"right\": [\"token\", 6]\n"
+ + "\t\t},\n"
+ + "\t\t\"fields\": [\"pubDate\", \"subTitle\", \"author\", \"pubPlace\", \"title\", \"textSigle\", \"UID\", \"ID\", \"layerInfos\", \"corpusSigle\", \"docSigle\", \"corpusID\", \"textClass\"],\n"
+ + "\t\t\"version\": \"0.55.5\",\n"
+ + "\t\t\"benchmark\": \"0.117436617 s\",\n"
+ + "\t\t\"totalResults\": 31,\n"
+ + "\t\t\"serialQuery\": \"tokens:s:das\",\n"
+ + "\t\t\"itemsPerPage\": 25\n"
+ + "\t},\n"
+ + "\t\"query\": {\n"
+ + "\t\t\"@type\": \"koral:token\",\n"
+ + "\t\t\"wrap\": {\n"
+ + "\t\t\t\"@type\": \"koral:term\",\n"
+ + "\t\t\t\"key\": \"das\",\n"
+ + "\t\t\t\"layer\": \"orth\",\n"
+ + "\t\t\t\"match\": \"match:eq\",\n"
+ + "\t\t\t\"foundry\": \"opennlp\",\n"
+ + "\t\t\t\"rewrites\": [{\n"
+ + "\t\t\t\t\"@type\": \"koral:rewrite\",\n"
+ + "\t\t\t\t\"src\": \"Kustvakt\",\n"
+ + "\t\t\t\t\"operation\": \"operation:injection\",\n"
+ + "\t\t\t\t\"scope\": \"foundry\"\n"
+ + "\t\t\t}]\n"
+ + "\t\t},\n"
+ + "\t\t\"idn\": \"das_0\",\n"
+ + "\t\t\"rewrites\": [{\n"
+ + "\t\t\t\"@type\": \"koral:rewrite\",\n"
+ + "\t\t\t\"src\": \"Kustvakt\",\n"
+ + "\t\t\t\"operation\": \"operation:injection\",\n"
+ + "\t\t\t\"scope\": \"idn\"\n"
+ + "\t\t}]\n"
+ + "\t},\n"
+ + "\t\"collection\": {\n"
+ + "\t\t\"@type\": \"koral:docGroup\",\n"
+ + "\t\t\"operation\": \"operation:or\",\n"
+ + "\t\t\"operands\": [{\n"
+ + "\t\t\t\"@type\": \"koral:doc\",\n"
+ + "\t\t\t\"key\": \"corpusSigle\",\n"
+ + "\t\t\t\"value\": \"GOE\",\n"
+ + "\t\t\t\"match\": \"match:eq\"\n"
+ + "\t\t}, {\n"
+ + "\t\t\t\"@type\": \"koral:doc\",\n"
+ + "\t\t\t\"key\": \"corpusSigle\",\n"
+ + "\t\t\t\"value\": \"WPD\",\n"
+ + "\t\t\t\"match\": \"match:eq\"\n"
+ + "\t\t}],\n"
+ + "\t\t\"rewrites\": [{\n"
+ + "\t\t\t\"@type\": \"koral:rewrite\",\n"
+ + "\t\t\t\"src\": \"Kustvakt\",\n"
+ + "\t\t\t\"operation\": \"operation:insertion\",\n"
+ + "\t\t\t\"scope\": \"corpusSigle\"\n"
+ + "\t\t}]\n"
+ + "\t},\n"
+ + "\t\"matches\": [{\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00004\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A (Logik)\",\n"
+ + "\t\t\"author\": \"Zenogantner; ElRaki; 1\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>z.B. mit dem Wort Barbara" bezeichnet, </span><mark>das</mark><span class=\\\"context-right\\\"> dreimal den Buchstaben a enthält, aber<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00004-p195-196\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"Aegukka\",\n"
+ + "\t\t\"author\": \"ThorstenS; 2\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>wörtlich "Das Lied der Liebe für </span><mark>das</mark><span class=\\\"context-right\\\"> Land", oder "Das patriotische Lied". Es<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.02439-p22-23\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"Aegukka\",\n"
+ + "\t\t\"author\": \"ThorstenS; 2\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Besatzungszeit von 1910 bis 1945 wurde </span><mark>das</mark><span class=\\\"context-right\\\"> Lied verboten. Im Ausland lebende Koreaner<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.02439-p74-75\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"Aegukka\",\n"
+ + "\t\t\"author\": \"ThorstenS; 2\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>3. Deutsche Übersetzung 1. Strophe Bis </span><mark>das</mark><span class=\\\"context-right\\\"> Meer des Ostens ausdörrt und der<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.02439-p298-299\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Ausnahme von Fremdwörtern und Namen ist </span><mark>das</mark><span class=\\\"context-right\\\"> A der einzige Buchstabe im Deutschen<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p41-42\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>flache Stellung niedergedrückt wird. Stellt man </span><mark>das</mark><span class=\\\"context-right\\\"> Verhältnis der drei Hauptvokale a, i<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p107-108\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>kommt i als der hellste an </span><mark>das</mark><span class=\\\"context-right\\\"> obere, u als der dumpfeste an<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p127-128\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>obere, u als der dumpfeste an </span><mark>das</mark><span class=\\\"context-right\\\"> untere Ende, a als der mittlere<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p134-135\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>im 9. Jahrhundert v. Chr. war </span><mark>das</mark><span class=\\\"context-right\\\"> Schriftzeichen bereits stark stilisiert, die Hörner<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p271-272\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>im Alphabet inne. Als die Griechen </span><mark>das</mark><span class=\\\"context-right\\\"> Phönizische Alphabet übernamen, drehten sie das<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p313-314\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>das Phönizische Alphabet übernamen, drehten sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen um 90 Grad und machten<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p319-320\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>um 90 Grad und machten daraus </span><mark>das</mark><span class=\\\"context-right\\\"> Alpha. Da das Griechische reich an<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p327-328\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>und machten daraus das Alpha. Da </span><mark>das</mark><span class=\\\"context-right\\\"> Griechische reich an Vokalen war, verwendeten<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p330-331\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>reich an Vokalen war, verwendeten sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen für den Lautwert a. Die<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p338-339\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>den Lautwert a. Die Etrusker übernahmen </span><mark>das</mark><span class=\\\"context-right\\\"> frühgriechische Alpha und ließen es größtenteils<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p347-348\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>von rechts nach links) versahen sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen mit einem Abschwung nach links<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p365-366\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Abschwung nach links. Als die Römer </span><mark>das</mark><span class=\\\"context-right\\\"> lateinische Alphabet schufen, verwendeten sie das<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p375-376\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>das lateinische Alphabet schufen, verwendeten sie </span><mark>das</mark><span class=\\\"context-right\\\"> A aus dem etruskischen Alphabet, der<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p381-382\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>in der Biologie steht A für </span><mark>das</mark><span class=\\\"context-right\\\"> Nukleosid Adenosin steht A die Base<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p404-405\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Wert 10, siehe auch Hexadezimalsystem. steht </span><mark>das</mark><span class=\\\"context-right\\\"> Symbol ∀ (ein auf den Kopf gestelltes<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p526-527\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>für die Vorsilbe Atto ist A </span><mark>das</mark><span class=\\\"context-right\\\"> Einheitensymbol der elektrischen Stromstärke Ampere in<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p624-625\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Anordnung (Rechtswesen), Agent (Börse), Aufzeichung (Rechtsw.), </span><mark>das</mark><span class=\\\"context-right\\\"> Flächenmaß Acre und Ausgabe A ist<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p757-758\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Band). in Redewendungen für den Anfang (</span><mark>das</mark><span class=\\\"context-right\\\"> A und O, von A bis<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p777-778\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Z). a ist die Abkürzung für </span><mark>das</mark><span class=\\\"context-right\\\"> Flächenmaß Ar in der Kaufmannssprache bedeutet<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p790-791\",\n"
+ + "\t\t\"UID\": 0,\n"
+ + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}, {\n"
+ + "\t\t\"field\": \"tokens\",\n"
+ + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
+ + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
+ + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
+ + "\t\t\"docSigle\": \"WPD_AAA\",\n"
+ + "\t\t\"corpusSigle\": \"WPD\",\n"
+ + "\t\t\"title\": \"A\",\n"
+ + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
+ + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
+ + "\t\t\"startMore\": true,\n"
+ + "\t\t\"endMore\": true,\n"
+ + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>ad zu) ‚[das Stück] zu...‘ für </span><mark>das</mark><span class=\\\"context-right\\\"> Französische à „nach“, z. B. in<span class=\\\"more\\\"></span></span>\",\n"
+ + "\t\t\"matchID\": \"match-WPD_AAA.00001-p805-806\",\n"
+ + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
+ + "\t}]\n" + "}";
+
+
+}
diff --git a/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java b/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
index b3387c6..8061071 100644
--- a/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
+++ b/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
@@ -9,6 +9,8 @@
import java.util.List;
+import static org.junit.Assert.*;
+
/**
* @author hanl
* @date 12/11/2015
@@ -33,79 +35,83 @@
@Test
- public void testGet () {
+ public void testGet () throws KustvaktException {
Document doc = new Document("BRZ13_APR.00002");
doc.setDisabled(true);
- try {
- dao.storeResource(doc, null);
- Document doc1 = dao.findbyId(doc.getPersistentID(), null);
- assert doc1 != null && doc.isDisabled();
- }
- catch (KustvaktException e) {
- e.printStackTrace();
- }
+ dao.storeResource(doc, null);
+ Document doc1 = dao.findbyId(doc.getPersistentID(), null);
+ assertNotNull(doc1);
+ assertTrue(doc.isDisabled());
}
@Test
- public void testRemove () {
+ public void testRemove () throws KustvaktException {
Document doc = new Document("BRZ13_APR.00003");
doc.setDisabled(true);
- try {
- dao.storeResource(doc, null);
- Document doc1 = dao.findbyId(doc.getPersistentID(), null);
- assert dao.deleteResource(doc.getPersistentID(), null) == 1;
- doc1 = dao.findbyId(doc.getPersistentID(), null);
- assert doc1 == null;
- }
- catch (KustvaktException e) {
- e.printStackTrace();
-
- }
+ dao.storeResource(doc, null);
+ Document doc1 = dao.findbyId(doc.getPersistentID(), null);
+ assertEquals(1, dao.deleteResource(doc.getPersistentID(), null));
+ doc1 = dao.findbyId(doc.getPersistentID(), null);
+ Assert.assertNull(doc1);
}
@Test
- public void testEmptyFind () {
- List<String> dc = null;
- try {
- dc = dao.findbyCorpus("WPD", true);
- }
- catch (KustvaktException e) {
- e.printStackTrace();
- }
-
- Assert.assertNotNull(dc);
- Assert.assertEquals("should be empty", 0, dc.size());
+ public void testEmptyFind () throws KustvaktException {
+ List<String> dc = dao.findbyCorpus("WPD", true);
+ assertNotNull(dc);
+ assertEquals("should be empty", 0, dc.size());
}
@Test
- public void testFind () {
+ public void testFindText () throws KustvaktException {
int length = 10;
for (int i = 0; i < length; i++) {
Document doc = new Document("WPD_APR.0000" + i);
doc.setDisabled(true);
- try {
- dao.storeResource(doc, null);
- }
- catch (KustvaktException e) {
- e.printStackTrace();
- break;
- }
+ dao.storeResource(doc, null);
}
+ List<String> dc = dao.findbyCorpus("WPD", true);
- List<String> dc = null;
- try {
- dc = dao.findbyCorpus("WPD", true);
- }
- catch (KustvaktException e) {
- e.printStackTrace();
- }
+ assertNotNull(dc);
+ assertNotSame("should not be empty", 0, dc.size());
+ assertEquals("not all found", length, dc.size());
+ }
- Assert.assertNotNull(dc);
- Assert.assertNotSame("should not be empty", 0, dc.size());
- Assert.assertEquals("not all found", length, dc.size());
+
+ @Test
+ public void testFindDocByText () throws KustvaktException {
+ Document doc = new Document("WPD_AAA", "WPD_AAA.02439");
+ doc.setDisabled(true);
+ dao.storeResource(doc, null);
+
+ Document dfind = dao.findbyId(doc.getPersistentID(), null);
+ assertNotNull(dfind);
+ assertEquals(doc.getPersistentID(), dfind.getPersistentID());
+ }
+
+
+ @Test
+ public void testFindDocByPartial () throws KustvaktException {
+ Document doc = new Document("WPD_AAA.02439");
+ doc.setDisabled(true);
+ Document doc1 = new Document("WPD_AAA.02343");
+ dao.storeResource(doc, null);
+ dao.storeResource(doc1, null);
+
+ List<Document> dfind = dao.findbyPartialId(doc.getDocSigle(), null);
+ assertNotNull(dfind);
+ assertNotEquals(0, dfind.size());
+ assertEquals(2, dfind.size());
+ assertEquals(doc.getDocSigle(), dfind.get(0).getDocSigle());
+
+ dfind = dao.findbyPartialId(doc.getCorpus(), null);
+ assertNotNull(dfind);
+ assertNotEquals(0, dfind.size());
+ assertEquals(2, dfind.size());
+ assertEquals(doc.getDocSigle(), dfind.get(0).getDocSigle());
}
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
index 8e67a30..0e43b97 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewriteTest.java
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import de.ids_mannheim.korap.config.BeanConfigTest;
import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.TestVariables;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.query.serialize.QuerySerializer;
import de.ids_mannheim.korap.user.User;
@@ -21,8 +22,6 @@
*/
public class CollectionRewriteTest extends BeanConfigTest {
- private static String simple_add_query = "[pos=ADJA]";
-
private static KustvaktConfiguration config;
@@ -52,7 +51,7 @@
handler.insertBeans(helper().getContext());
handler.add(CollectionConstraint.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("textClass=politik & corpusSigle=WPD");
String result = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(result,
@@ -74,21 +73,17 @@
handler.insertBeans(helper().getContext());
handler.add(CollectionConstraint.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("corpusSigle=BRZ13 & corpusSigle=WPD");
String result = s.toJSON();
- try {
- JsonNode node = JsonUtils.readTree(handler.processQuery(result,
- User.UserFactory.getUser("test_user")));
- System.out.println(node);
- assertNotNull(node);
- assertEquals(0, node.at("/collection/operands").size());
- assertEquals("koral:rewrite",
- node.at("/collection/rewrites/0/@type").asText());
- }
- catch (Exception e) {
- e.printStackTrace();
- }
+
+ JsonNode node = JsonUtils.readTree(handler.processQuery(result,
+ User.UserFactory.getUser("test_user")));
+ System.out.println(node);
+ assertNotNull(node);
+ assertEquals(0, node.at("/collection/operands").size());
+ assertEquals("koral:rewrite", node.at("/collection/rewrites/0/@type")
+ .asText());
}
@@ -98,7 +93,7 @@
handler.insertBeans(helper().getContext());
handler.add(CollectionConstraint.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(corpusSigle=BRZ13 & textClass=Wissenschaft) & corpusSigle=WPD");
String result = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(result,
@@ -122,7 +117,7 @@
handler.add(CollectionConstraint.class);
handler.add(CollectionCleanRewrite.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(corpusSigle=BRZ13 & corpusSigle=WPD) & textClass=Wissenschaft & textClass=Sport");
String result = s.toJSON();
@@ -150,7 +145,7 @@
handler.add(CollectionConstraint.class);
handler.add(CollectionCleanRewrite.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(corpusSigle=BRZ13 & textClass=wissenschaft)");
String result = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(result,
@@ -171,7 +166,7 @@
handler.add(CollectionConstraint.class);
handler.add(CollectionCleanRewrite.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(corpusSigle=BRZ13 & corpusSigle=WPD) & textClass=Wissenschaft");
String result = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(result,
@@ -192,7 +187,7 @@
handler.add(CollectionConstraint.class);
handler.add(CollectionCleanRewrite.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(docID=random & textClass=Wissenschaft) & corpusSigle=WPD");
String org = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(org,
@@ -217,7 +212,7 @@
handler.add(PublicCollection.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
String org = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(org,
User.UserFactory.getUser("test_user")));
@@ -240,7 +235,7 @@
handler.add(PublicCollection.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(docSigle=WPD_AAA & textClass=wissenschaft)");
String org = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(org,
@@ -262,7 +257,7 @@
handler.insertBeans(helper().getContext());
handler.add(CollectionConstraint.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(corpusSigle=BRZ14 & textClass=wissenschaft) | (corpusSigle=AZPR | textClass=freizeit)");
String org = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(org,
@@ -289,7 +284,7 @@
// todo: use this collection query also to test clean up filter! after reduction of corpusSigle (wiss | freizeit)!
handler.add(CollectionCleanRewrite.class);
QuerySerializer s = new QuerySerializer();
- s.setQuery(simple_add_query, "poliqarp");
+ s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(corpusSigle=BRZ14 & textClass=wissenschaft) | (corpusSigle=AZPR | textClass=freizeit)");
String org = s.toJSON();
JsonNode node = JsonUtils.readTree(handler.processQuery(org,
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
index 068a424..479927c 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.TestVariables;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.handlers.DocumentDao;
import de.ids_mannheim.korap.resources.Document;
@@ -16,8 +17,6 @@
* @author hanl
* @date 12/11/2015
*/
-// todo: should differentiate between docsigle and textsigle
-// todo: logging!
public class ResultRewriteTest extends BeanConfigTest {
@Override
@@ -47,9 +46,9 @@
.getPersistenceClient());
Document d = dao.findbyId("BRZ13_APR.00014", null);
assertNull(d);
- String v = ha.processResult(RESULT, null);
- assertEquals("results do not match", JsonUtils.readTree(RESULT),
- JsonUtils.readTree(v));
+ String v = ha.processResult(TestVariables.RESULT, null);
+ assertEquals("results do not match",
+ JsonUtils.readTree(TestVariables.RESULT), JsonUtils.readTree(v));
}
@@ -67,485 +66,21 @@
assertEquals("Handler could not be added to rewrite handler instance!",
true, ha.add(DocMatchRewrite.class));
- JsonNode check = JsonUtils.readTree(RESULT);
+ JsonNode check = JsonUtils.readTree(TestVariables.RESULT);
assertNotNull(check);
int check_size = check.at("/matches").size();
- String v = ha.processResult(RESULT, null);
+ String v = ha.processResult(TestVariables.RESULT, null);
JsonNode node = JsonUtils.readTree(v);
assertNotNull(node);
int size = node.at("/matches").size();
assertNotEquals("documents were not removed", check_size, size);
- assertEquals(22, size);
+ assertEquals("result does not contain required matches", 22, size);
dao.deleteResource(doc.getPersistentID(), null);
Document d = dao.findbyId(doc.getPersistentID(), null);
- assertNull(d);
+ assertNull("document should not exist anymore!", d);
}
-
-
- private static final String RESULT = "{\n"
- + "\t\"@context\": \"http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld\",\n"
- + "\t\"meta\": {\n"
- + "\t\t\"count\": 25,\n"
- + "\t\t\"startIndex\": 0,\n"
- + "\t\t\"timeout\": 120000,\n"
- + "\t\t\"context\": {\n"
- + "\t\t\t\"left\": [\"token\", 6],\n"
- + "\t\t\t\"right\": [\"token\", 6]\n"
- + "\t\t},\n"
- + "\t\t\"fields\": [\"pubDate\", \"subTitle\", \"author\", \"pubPlace\", \"title\", \"textSigle\", \"UID\", \"ID\", \"layerInfos\", \"corpusSigle\", \"docSigle\", \"corpusID\", \"textClass\"],\n"
- + "\t\t\"version\": \"0.55.5\",\n"
- + "\t\t\"benchmark\": \"0.117436617 s\",\n"
- + "\t\t\"totalResults\": 31,\n"
- + "\t\t\"serialQuery\": \"tokens:s:das\",\n"
- + "\t\t\"itemsPerPage\": 25\n"
- + "\t},\n"
- + "\t\"query\": {\n"
- + "\t\t\"@type\": \"koral:token\",\n"
- + "\t\t\"wrap\": {\n"
- + "\t\t\t\"@type\": \"koral:term\",\n"
- + "\t\t\t\"key\": \"das\",\n"
- + "\t\t\t\"layer\": \"orth\",\n"
- + "\t\t\t\"match\": \"match:eq\",\n"
- + "\t\t\t\"foundry\": \"opennlp\",\n"
- + "\t\t\t\"rewrites\": [{\n"
- + "\t\t\t\t\"@type\": \"koral:rewrite\",\n"
- + "\t\t\t\t\"src\": \"Kustvakt\",\n"
- + "\t\t\t\t\"operation\": \"operation:injection\",\n"
- + "\t\t\t\t\"scope\": \"foundry\"\n"
- + "\t\t\t}]\n"
- + "\t\t},\n"
- + "\t\t\"idn\": \"das_0\",\n"
- + "\t\t\"rewrites\": [{\n"
- + "\t\t\t\"@type\": \"koral:rewrite\",\n"
- + "\t\t\t\"src\": \"Kustvakt\",\n"
- + "\t\t\t\"operation\": \"operation:injection\",\n"
- + "\t\t\t\"scope\": \"idn\"\n"
- + "\t\t}]\n"
- + "\t},\n"
- + "\t\"collection\": {\n"
- + "\t\t\"@type\": \"koral:docGroup\",\n"
- + "\t\t\"operation\": \"operation:or\",\n"
- + "\t\t\"operands\": [{\n"
- + "\t\t\t\"@type\": \"koral:doc\",\n"
- + "\t\t\t\"key\": \"corpusSigle\",\n"
- + "\t\t\t\"value\": \"GOE\",\n"
- + "\t\t\t\"match\": \"match:eq\"\n"
- + "\t\t}, {\n"
- + "\t\t\t\"@type\": \"koral:doc\",\n"
- + "\t\t\t\"key\": \"corpusSigle\",\n"
- + "\t\t\t\"value\": \"WPD\",\n"
- + "\t\t\t\"match\": \"match:eq\"\n"
- + "\t\t}],\n"
- + "\t\t\"rewrites\": [{\n"
- + "\t\t\t\"@type\": \"koral:rewrite\",\n"
- + "\t\t\t\"src\": \"Kustvakt\",\n"
- + "\t\t\t\"operation\": \"operation:insertion\",\n"
- + "\t\t\t\"scope\": \"corpusSigle\"\n"
- + "\t\t}]\n"
- + "\t},\n"
- + "\t\"matches\": [{\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00004\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A (Logik)\",\n"
- + "\t\t\"author\": \"Zenogantner; ElRaki; 1\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>z.B. mit dem Wort Barbara" bezeichnet, </span><mark>das</mark><span class=\\\"context-right\\\"> dreimal den Buchstaben a enthält, aber<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00004-p195-196\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"Aegukka\",\n"
- + "\t\t\"author\": \"ThorstenS; 2\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>wörtlich "Das Lied der Liebe für </span><mark>das</mark><span class=\\\"context-right\\\"> Land", oder "Das patriotische Lied". Es<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.02439-p22-23\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"Aegukka\",\n"
- + "\t\t\"author\": \"ThorstenS; 2\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Besatzungszeit von 1910 bis 1945 wurde </span><mark>das</mark><span class=\\\"context-right\\\"> Lied verboten. Im Ausland lebende Koreaner<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.02439-p74-75\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"kultur musik freizeit-unterhaltung reisen\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.02439\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"Aegukka\",\n"
- + "\t\t\"author\": \"ThorstenS; 2\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>3. Deutsche Übersetzung 1. Strophe Bis </span><mark>das</mark><span class=\\\"context-right\\\"> Meer des Ostens ausdörrt und der<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.02439-p298-299\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Ausnahme von Fremdwörtern und Namen ist </span><mark>das</mark><span class=\\\"context-right\\\"> A der einzige Buchstabe im Deutschen<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p41-42\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>flache Stellung niedergedrückt wird. Stellt man </span><mark>das</mark><span class=\\\"context-right\\\"> Verhältnis der drei Hauptvokale a, i<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p107-108\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>kommt i als der hellste an </span><mark>das</mark><span class=\\\"context-right\\\"> obere, u als der dumpfeste an<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p127-128\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>obere, u als der dumpfeste an </span><mark>das</mark><span class=\\\"context-right\\\"> untere Ende, a als der mittlere<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p134-135\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>im 9. Jahrhundert v. Chr. war </span><mark>das</mark><span class=\\\"context-right\\\"> Schriftzeichen bereits stark stilisiert, die Hörner<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p271-272\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>im Alphabet inne. Als die Griechen </span><mark>das</mark><span class=\\\"context-right\\\"> Phönizische Alphabet übernamen, drehten sie das<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p313-314\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>das Phönizische Alphabet übernamen, drehten sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen um 90 Grad und machten<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p319-320\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>um 90 Grad und machten daraus </span><mark>das</mark><span class=\\\"context-right\\\"> Alpha. Da das Griechische reich an<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p327-328\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>und machten daraus das Alpha. Da </span><mark>das</mark><span class=\\\"context-right\\\"> Griechische reich an Vokalen war, verwendeten<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p330-331\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>reich an Vokalen war, verwendeten sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen für den Lautwert a. Die<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p338-339\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>den Lautwert a. Die Etrusker übernahmen </span><mark>das</mark><span class=\\\"context-right\\\"> frühgriechische Alpha und ließen es größtenteils<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p347-348\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>von rechts nach links) versahen sie </span><mark>das</mark><span class=\\\"context-right\\\"> Zeichen mit einem Abschwung nach links<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p365-366\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Abschwung nach links. Als die Römer </span><mark>das</mark><span class=\\\"context-right\\\"> lateinische Alphabet schufen, verwendeten sie das<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p375-376\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>das lateinische Alphabet schufen, verwendeten sie </span><mark>das</mark><span class=\\\"context-right\\\"> A aus dem etruskischen Alphabet, der<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p381-382\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>in der Biologie steht A für </span><mark>das</mark><span class=\\\"context-right\\\"> Nukleosid Adenosin steht A die Base<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p404-405\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Wert 10, siehe auch Hexadezimalsystem. steht </span><mark>das</mark><span class=\\\"context-right\\\"> Symbol ∀ (ein auf den Kopf gestelltes<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p526-527\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>für die Vorsilbe Atto ist A </span><mark>das</mark><span class=\\\"context-right\\\"> Einheitensymbol der elektrischen Stromstärke Ampere in<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p624-625\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Anordnung (Rechtswesen), Agent (Börse), Aufzeichung (Rechtsw.), </span><mark>das</mark><span class=\\\"context-right\\\"> Flächenmaß Acre und Ausgabe A ist<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p757-758\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Band). in Redewendungen für den Anfang (</span><mark>das</mark><span class=\\\"context-right\\\"> A und O, von A bis<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p777-778\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>Z). a ist die Abkürzung für </span><mark>das</mark><span class=\\\"context-right\\\"> Flächenmaß Ar in der Kaufmannssprache bedeutet<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p790-791\",\n"
- + "\t\t\"UID\": 0,\n"
- + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}, {\n"
- + "\t\t\"field\": \"tokens\",\n"
- + "\t\t\"textClass\": \"freizeit-unterhaltung reisen wissenschaft populaerwissenschaft\",\n"
- + "\t\t\"pubPlace\": \"URL:http://de.wikipedia.org\",\n"
- + "\t\t\"textSigle\": \"WPD_AAA.00001\",\n"
- + "\t\t\"docSigle\": \"WPD_AAA\",\n"
- + "\t\t\"corpusSigle\": \"WPD\",\n"
- + "\t\t\"title\": \"A\",\n"
- + "\t\t\"author\": \"Ruru; Jens.Ol; Aglarech; u.a.\",\n"
- + "\t\t\"layerInfos\": \"base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/s=spans mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans\",\n"
- + "\t\t\"startMore\": true,\n"
- + "\t\t\"endMore\": true,\n"
- + "\t\t\"snippet\": \"<span class=\\\"context-left\\\"><span class=\\\"more\\\"></span>ad zu) ‚[das Stück] zu...‘ für </span><mark>das</mark><span class=\\\"context-right\\\"> Französische à „nach“, z. B. in<span class=\\\"more\\\"></span></span>\",\n"
- + "\t\t\"matchID\": \"match-WPD_AAA.00001-p805-806\",\n"
- + "\t\t\"UID\": 0,\n" + "\t\t\"pubDate\": \"2005-03-28\"\n"
- + "\t}]\n" + "}";
-
}
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java
new file mode 100644
index 0000000..29ddb89
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java
@@ -0,0 +1,102 @@
+package de.ids_mannheim.korap.resource.rewrite;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.TestVariables;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.handlers.DocumentDao;
+import de.ids_mannheim.korap.resources.Document;
+import de.ids_mannheim.korap.utils.JsonUtils;
+import de.ids_mannheim.korap.utils.TimeUtils;
+import org.joda.time.DateTime;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by hanl on 30.05.16.
+ */
+public class RewriteBenchmarkTest extends BeanConfigTest {
+
+
+ @Test
+ public void testDocMatchRewriteByTextSigle () throws KustvaktException {
+ DocumentDao dao = new DocumentDao(helper().getContext()
+ .getPersistenceClient());
+
+ int i = 999;
+ for (int j = 100; j < i; j++) {
+ Document doc = new Document("WPD_AAA.02" + j);
+ doc.setDisabled(true);
+ dao.storeResource(doc, null);
+ }
+ RewriteHandler ha = new RewriteHandler();
+ ha.insertBeans(helper().getContext());
+ assertEquals("Handler could not be added to rewrite handler instance!",
+ true, ha.add(DocMatchRewrite.class));
+
+ DateTime now = TimeUtils.getNow();
+ String v = ha.processResult(TestVariables.RESULT, null);
+ long diff = TimeUtils.calcDiff(now, new DateTime());
+ assertTrue(diff < 600);
+ JsonNode node = JsonUtils.readTree(v);
+
+ JsonNode check = JsonUtils.readTree(TestVariables.RESULT);
+ assertNotNull(check);
+ int check_size = check.at("/matches").size();
+
+ assertNotNull(node);
+ int size = node.at("/matches").size();
+ assertNotEquals("documents were not removed", check_size, size);
+
+ dao.truncate();
+ }
+
+
+ @Test
+ public void testDocMatchRewriteByDocSigle () throws KustvaktException {
+ DocumentDao dao = new DocumentDao(helper().getContext()
+ .getPersistenceClient());
+
+ Document doc = new Document("WPD_AAA");
+ doc.setDisabled(true);
+ dao.storeResource(doc, null);
+
+ RewriteHandler ha = new RewriteHandler();
+ ha.insertBeans(helper().getContext());
+ assertEquals("Handler could not be added to rewrite handler instance!",
+ true, ha.add(DocMatchRewrite.class));
+
+ DateTime now = TimeUtils.getNow();
+ String v = ha.processResult(TestVariables.RESULT, null);
+ long diff = TimeUtils.calcDiff(now, new DateTime());
+ assertTrue(diff < 600);
+ JsonNode node = JsonUtils.readTree(v);
+
+ JsonNode check = JsonUtils.readTree(TestVariables.RESULT);
+ assertNotNull(check);
+ int check_size = check.at("/matches").size();
+
+ assertNotNull(node);
+ int size = node.at("/matches").size();
+ assertNotEquals("documents were not removed", check_size, size);
+ assertEquals(0, size);
+ dao.truncate();
+ }
+
+
+ @Test
+ public void testCollectionRewriteInject () {
+
+ }
+
+
+ @Test
+ public void testCollectionRewriteRemoval () {
+
+ }
+
+
+ @Override
+ public void initMethod () throws KustvaktException {}
+}
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
index 112282c..3cb528d 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
@@ -19,19 +19,6 @@
*/
public class RewriteHandlerTest extends BeanConfigTest {
- @Test
- public void initHandler () {
- try {
- RewriteHandler handler = new RewriteHandler();
- handler.insertBeans(helper().getContext());
- assertTrue(handler.add(FoundryInject.class));
- }
- catch (Exception e) {
- e.printStackTrace();
-
- }
- }
-
@Test
public void testRewriteTaskAdd () {
@@ -111,6 +98,7 @@
UserDataDbIface settingsdao = BeansFactory.getTypeFactory()
.getTypedBean(helper().getContext().getUserDataDaos(),
UserSettings.class);
+ assertNotNull(settingsdao);
UserSettings s = (UserSettings) settingsdao.get(helper().getUser());
s.setField(Attributes.DEFAULT_LEMMA_FOUNDRY, "tt_test");
settingsdao.update(s);
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
index b394d68..47771b1 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
@@ -51,6 +51,31 @@
}
+
+ @Test
+ public void testOpenIDLogin () {
+
+ }
+
+
+ @Test
+ public void testOpenIDLogout () {
+
+ }
+
+
+ // -- are these even right? auth - authorization
+ @Test
+ public void testOAuth2Login () {
+
+ }
+
+
+ @Test
+ public void testOAuth2Logout () {
+
+ }
+
//todo: test basicauth via secure connection
}
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
index 039593e..6896054 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.sun.jersey.api.client.ClientResponse;
import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
import de.ids_mannheim.korap.config.Attributes;
import de.ids_mannheim.korap.utils.JsonUtils;
@@ -28,11 +29,11 @@
@Test
- public void testSearchSimple () {
+ public void testSearchSimpleAuthorized () {
ClientResponse response = resource()
.path(getAPIVersion())
.path("search")
- .queryParam("q", "[orth=das]")
+ .queryParam("q", "[orth=Haus]")
.queryParam("ql", "poliqarp")
.header(Attributes.AUTHORIZATION,
BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
@@ -42,13 +43,113 @@
JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
assertNotNull(node);
- System.out.println("NODE " + node);
assertNotEquals(0, node.path("matches").size());
}
@Test
- public void testCollectionGet () {
+ public void testSearchSimpleWithCQAuthorized () {
+ ClientResponse response = resource()
+ .path(getAPIVersion())
+ .path("search")
+ .queryParam("q", "[orth=das]")
+ .queryParam("ql", "poliqarp")
+ .queryParam("cq", "textClass=politik && corpusSigle=WPD")
+ .header(Attributes.AUTHORIZATION,
+ BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+ .get(ClientResponse.class);
+ assertEquals(ClientResponse.Status.OK.getStatusCode(),
+ response.getStatus());
+
+ JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
+ assertNotNull(node);
+
+ }
+
+
+ @Test
+ public void testSearchSimpleDemo () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("search").queryParam("q", "[base=Haus]")
+ .queryParam("ql", "poliqarp").get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ System.out.println("NODE " + node);
+ assertNotNull(node);
+ assertNotEquals(0, node.path("matches").size());
+ }
+
+
+ @Test
+ public void testSearchSentenceMeta () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("search").queryParam("q", "[base=Haus]")
+ .queryParam("ql", "poliqarp").queryParam("context", "sentence")
+ .get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.path("matches").size());
+ assertEquals("base/s:s", node.at("/meta/context").asText());
+ assertNotEquals("${project.version}", "/meta/version");
+ }
+
+
+ @Test
+ public void testSearchSimpleCQL () {
+ QuerySerializer s = new QuerySerializer();
+ s.setQuery("[base=Haus]", "poliqarp");
+
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("search").post(ClientResponse.class, s.toJSON());
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.path("matches").size());
+ }
+
+
+ @Test
+ public void testSearchRawQuery () {
+ QuerySerializer s = new QuerySerializer();
+ s.setQuery("[base=Haus]", "poliqarp");
+ // s.setCollection("corpusSigle=WPD");
+
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("search").post(ClientResponse.class, s.toJSON());
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+
+ System.out.println(ent);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.path("matches").size());
+ }
+
+
+ @Test
+ public void testCollectionsGetPublic () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("collection").get(ClientResponse.class);
+ assertEquals(ClientResponse.Status.OK.getStatusCode(),
+ response.getStatus());
+
+ JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
+ assertNotNull(node);
+ assertNotEquals(0, node.size());
+ }
+
+
+ @Test
+ public void testCollectionsGet () {
ClientResponse response = resource()
.path(getAPIVersion())
.path("collection")
@@ -59,6 +160,33 @@
response.getStatus());
JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
+ assertNotNull(node);
+ assertNotEquals(0, node.size());
+ }
+
+
+ @Test
+ public void testCorporaGet () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("corpus").get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.size());
+ }
+
+
+ @Test
+ public void testFoundriesGet () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("foundry").get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
assertNotEquals(0, node.size());
}
@@ -100,6 +228,46 @@
@Test
+ public void testCollecionGet () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("collection").path("id").get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.size());
+
+ }
+
+
+ @Test
+ public void testCorpusGet () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("corpus").path("id").get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.size());
+ }
+
+
+ @Test
+ public void testFoundryGet () {
+ ClientResponse response = resource().path(getAPIVersion())
+ .path("foundry").path("id").get(ClientResponse.class);
+ assertEquals(response.getStatus(),
+ ClientResponse.Status.OK.getStatusCode());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertNotEquals(0, node.size());
+ }
+
+
+ @Test
public void testResourceStore () {
}
@@ -112,22 +280,82 @@
@Test
- @Ignore
- public void testSerializationQueryInCollection () {
+ public void testSerializationQueryWithCorpusUnAuthorized () {
ClientResponse response = resource().path(getAPIVersion())
.path("corpus/WPD/search").queryParam("q", "[base=Haus]")
.queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
.method("TRACE", ClientResponse.class);
- assertEquals(response.getStatus(),
- ClientResponse.Status.OK.getStatusCode());
- System.out.println("RESPONSE 1 " + response);
+ assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
+ response.getStatus());
String ent = response.getEntity(String.class);
- System.out.println("Entity 1 " + ent);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertEquals(401, node.at("/errors/0/0").asInt());
}
@Test
- public void testSerializationQueryPublic () {
+ public void testSerializationQueryWithCorpus () {
+ ClientResponse response = resource()
+ .path(getAPIVersion())
+ .path("corpus/WPD/search")
+ .queryParam("q", "[base=Haus]")
+ .queryParam("ql", "poliqarp")
+ .queryParam("context", "base/s:s")
+ .header(Attributes.AUTHORIZATION,
+ BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+ .method("TRACE", ClientResponse.class);
+ assertEquals(ClientResponse.Status.OK.getStatusCode(),
+ response.getStatus());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ assertEquals("koral:doc", node.at("/collection/@type").asText());
+ }
+
+
+ @Test
+ public void testSerializationQueryWithCollection () {
+ ClientResponse response = resource()
+ .path(getAPIVersion())
+ .path("collection")
+ .header(Attributes.AUTHORIZATION,
+ BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+ .get(ClientResponse.class);
+ assertEquals(ClientResponse.Status.OK.getStatusCode(),
+ response.getStatus());
+ String ent = response.getEntity(String.class);
+ JsonNode node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+
+ String id = node.at("/0/id").asText();
+ assertNotNull(id);
+ assertFalse(id.isEmpty());
+
+ response = resource()
+ .path(getAPIVersion())
+ .path("collection")
+ .path(id)
+ .path("search")
+ .queryParam("q", "[base=Haus]")
+ .queryParam("ql", "poliqarp")
+ .queryParam("context", "base/s:s")
+ .header(Attributes.AUTHORIZATION,
+ BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+ .method("TRACE", ClientResponse.class);
+ assertEquals(ClientResponse.Status.OK.getStatusCode(),
+ response.getStatus());
+ ent = response.getEntity(String.class);
+ node = JsonUtils.readTree(ent);
+ assertNotNull(node);
+ System.out.println(node);
+ assertEquals("koral:doc", node.at("/collection/@type").asText());
+
+ }
+
+
+ @Test
+ public void testSerializationQueryPublicCorpora () {
ClientResponse response = resource().path(getAPIVersion())
.path("search").queryParam("q", "[base=Haus]")
.queryParam("ql", "poliqarp").queryParam("context", "sentence")
@@ -143,60 +371,41 @@
}
- @Test
- public void testQuery () {
- ClientResponse response = resource().path(getAPIVersion())
- .path("search").queryParam("q", "[base=Haus]")
- .queryParam("ql", "poliqarp").queryParam("context", "sentence")
- .get(ClientResponse.class);
- assertEquals(response.getStatus(),
- ClientResponse.Status.OK.getStatusCode());
- String ent = response.getEntity(String.class);
- JsonNode node = JsonUtils.readTree(ent);
- assertNotNull(node);
- assertEquals("base/s:s", node.at("/meta/context").asText());
- assertNotEquals("${project.version}", "/meta/version");
- }
-
-
+ // use trace for this
@Test
@Ignore
public void testSerializationMeta () {
ClientResponse response = resource().path(getAPIVersion())
.path("search").queryParam("context", "sentence")
.queryParam("q", "[pos=ADJA]").queryParam("ql", "poliqarp")
- .get(ClientResponse.class);
+
+ .method("TRACE", ClientResponse.class);
assertEquals(response.getStatus(),
ClientResponse.Status.OK.getStatusCode());
}
@Test
- @Ignore
- public void testSerializationCollection () {
- ClientResponse response = resource().path(getAPIVersion()).path("")
- .get(ClientResponse.class);
- assertEquals(response.getStatus(),
- ClientResponse.Status.OK.getStatusCode());
- }
-
-
- @Test
- public void testMatchInfo () {
+ public void testMatchInfoGet () {
}
@Test
- public void testGetResources () {
- ClientResponse response = resource().path(getAPIVersion())
- .path("collection").get(ClientResponse.class);
- assertEquals(response.getStatus(),
- ClientResponse.Status.OK.getStatusCode());
- String ent = response.getEntity(String.class);
- JsonNode node = JsonUtils.readTree(ent);
- assertNotNull(node);
- assertNotEquals(0, node.size());
+ public void testMatchInfoSave () {
+
+ }
+
+
+ @Test
+ public void testMatchInfoDelete () {
+
+ }
+
+
+ @Test
+ public void testGetMatches () {
+
}