cleanup
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
index b2a195d..7ff8729 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
@@ -461,7 +461,8 @@
value = valNode.getChild(0).getChild(0).toStringTree(poliqarpParser); //e.g. (simple_query (sq_segment foo))
} else if (valType.equals("re_query")) {
value = valNode.getChild(0).toStringTree(poliqarpParser); //e.g. (re_query "bar*")
- fieldMap.put("@subtype", "value#regex");
+ fieldMap.put("@type", "term:regex");
+ value = value.substring(1,value.length()-1); //remove trailing quotes
}
fieldMap.put("key", value);
if (fieldName.contains("/")) {
diff --git a/src/test/java/PoliqarpPlusTreeTest.java b/src/test/java/PoliqarpPlusTreeTest.java
index 5a69053..2803129 100644
--- a/src/test/java/PoliqarpPlusTreeTest.java
+++ b/src/test/java/PoliqarpPlusTreeTest.java
@@ -66,6 +66,15 @@
}
@Test
+ public void testRegex() throws QueryException {
+ String query = "[orth=\"M(a|ä)nn(er)?\"]";
+ String re1 = "{@type=korap:token, wrap={@type=korap:term, @type=term:regex, key=M(a|ä)nn(er)?, layer=orth, match=eq}}";
+ ppt = new PoliqarpPlusTree(query);
+ map = ppt.getRequestMap().get("query").toString();
+ assertEquals(re1.replaceAll(" ", ""), map.replaceAll(" ", ""));
+ }
+
+ @Test
public void testElements() throws QueryException {
// <s>
String elem1 = "{@type=korap:span, key=s}";