solving <s> layer serialization;
Change-Id: I9fea6fe83e5d82e7219814d5964251664c269780
Reviewed-on: https://korap.ids-mannheim.de/gerrit/c/KorAP/Koral/+/7376
Reviewed-by: Nils Diewald <nils@diewald-online.de>
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CQPQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CQPQueryProcessor.java
index c62987a..9e0a77c 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CQPQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CQPQueryProcessor.java
@@ -1089,7 +1089,10 @@
key = keyNode.getText();
}
else key = node.getChild(node.getChildCount()-2).getText();
-
+ // for s-structures: <s>
+ if (key.equals("s")){
+ wrappedTerm.put("layer", "s");
+ }
wrappedTerm.put("key", key);
if (termOpNode != null) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
index 91f1a27..ac37f1e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
@@ -35,12 +35,10 @@
Map<String, Object> span = new HashMap<String, Object>();
span.put("@type", KoralType.SPAN.toString());
Map<String, Object> term = makeTerm();
- term.put("key", key);
- // EM: adding structure layer
- //EI: remove structure layer
- /* if (key.equals("s")){
+ if (key.equals("s")){
term.put("layer", "s");
- }*/
+ }
+ term.put("key", key);
span.put("wrap", term);
return span;
}