Added default foundry for structure layer.

Change-Id: I808745f3e4ae83157204a13061bd3f6b2d6e799c
diff --git a/core/Changes b/core/Changes
index 5d8758f..3f2d0b7 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,3 +1,8 @@
+# version 0.61.6
+
+06/02/2018
+   - Added default foundry for structure layer (margaretha)
+
 # version 0.61.5
 17/12/2018
    - Added search timeout in meta query (margaretha)
diff --git a/core/pom.xml b/core/pom.xml
index aff703d..109ef97 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -3,7 +3,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.ids_mannheim.korap</groupId>
 	<artifactId>Kustvakt-core</artifactId>
-	<version>0.61.5</version>
+	<version>0.61.6</version>
 
 	<properties>
 		<java.version>1.8</java.version>
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/Attributes.java b/core/src/main/java/de/ids_mannheim/korap/config/Attributes.java
index 2ad58cc..a3e2433 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/Attributes.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/Attributes.java
@@ -149,7 +149,8 @@
     public static final String DEFAULT_FOUNDRY_CONSTITUENT = "constituent-foundry";
     public static final String DEFAULT_FOUNDRY_RELATION = "relation-foundry";
     public static final String DEFAULT_FOUNDRY_MORPHOLOGY = "morphology-foundry";
-
+    public static final String DEFAULT_FOUNDRY_STRUCTURE = "structure-foundry";
+    
     /**
      * db column keys
      */
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index f4f107f..87f0838 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -73,9 +73,10 @@
     private String default_pos;
     private String default_morphology;
     private String default_lemma;
-    private String default_token;
+    private String default_orthography;
     private String default_dep;
     private String default_const;
+    private String defaultStructureFoundry;
     private ArrayList<String> foundries;
     private ArrayList<String> layers;
 
@@ -140,8 +141,10 @@
         default_morphology = properties.getProperty("default.foundry.morphology", "marmot");
         default_pos =
                 properties.getProperty("default.foundry.partOfSpeech", "tt");
-        default_token =
+        default_orthography =
                 properties.getProperty("default.foundry.orthography", "opennlp");
+        defaultStructureFoundry =
+                properties.getProperty("default.foundry.structure", "base");
 
         // security configuration
         inactiveTime = TimeUtils.convertTimeToSeconds(
diff --git a/core/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java b/core/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java
index a8a81bd..29360d9 100644
--- a/core/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java
+++ b/core/src/main/java/de/ids_mannheim/korap/rewrite/LayerMapper.java
@@ -53,6 +53,9 @@
                 case "surface":
                     return "opennlp";
                 // EM: added
+                case "s":
+                    return (String) settings
+                            .get(Attributes.DEFAULT_FOUNDRY_STRUCTURE);    
                 case "morphology":
                     return (String) settings
                             .get(Attributes.DEFAULT_FOUNDRY_MORPHOLOGY);    
@@ -72,13 +75,14 @@
                     return config.getDefault_pos();
                 case "lemma":
                     return config.getDefault_lemma();
-                case "morphology":
-                    return config.getDefault_morphology();
                 case "surface":
-                    return config.getDefault_token();
+                    return config.getDefault_orthography();
                     // refers to "structure" and is used for paragraphs or sentence boundaries
                 case "s":
-                    return "base";
+                    return config.getDefaultStructureFoundry();
+                //EM: added
+                case "morphology":
+                    return config.getDefault_morphology();
                 default:
                     // if the layer is not in this specific listing, assume a default layer
                     // like orth or other tokenization layers
@@ -101,8 +105,10 @@
                 //todo the orth layer does not need a foundry entry
             case "orth":
                 return "surface";
-            case "t":
-                return "surface";
+            // EM: layer t does not exist at all   
+//            case "t":
+//                return "surface";
+            // EM: this islegacy support    
             case "const":
                 return "c";
             case "p":