Added mate morpho tests

Change-Id: I16ab6b777b0d9f1241b755e25f3e0682ce18baaa
diff --git a/t/index/corpus/doc/text/mate/dependency.xml b/t/index/corpus/doc/text/mate/dependency.xml
new file mode 100644
index 0000000..eeb1186
--- /dev/null
+++ b/t/index/corpus/doc/text/mate/dependency.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
+<layer docid="Corpus_Doc.0001"
+       version="KorA-0.2"
+       xmlns="http://ids-mannheim.de/ns/KorA">
+  <spanList>
+    <span from="0"
+          to="3">
+      <rel label="MO">
+        <span from="31"
+              to="35" />
+      </rel>
+    </span>
+    <span from="4"
+          to="11">
+      <rel label="NK">
+        <span from="24"
+              to="30" />
+      </rel>
+    </span>
+    <span from="12"
+          to="23">
+      <rel label="NK">
+        <span from="24"
+              to="30" />
+      </rel>
+    </span>
+    <span from="24"
+          to="30">
+      <rel label="NK">
+        <span from="0"
+              to="3" />
+      </rel>
+    </span>
+    <span from="31"
+          to="35">
+      <rel label="--"
+           type="unary" />
+    </span>
+    <span from="36"
+          to="39">
+      <rel label="NK">
+        <span from="40"
+              to="47" />
+      </rel>
+    </span>
+    <span from="40"
+          to="47">
+      <rel label="SB">
+        <span from="31"
+              to="35" />
+      </rel>
+    </span>
+    <span from="48"
+          to="51">
+      <rel label="NK">
+        <span from="52"
+              to="63" />
+      </rel>
+    </span>
+    <span from="52"
+          to="63">
+      <rel label="AG">
+        <span from="40"
+              to="47" />
+      </rel>
+    </span>
+    <span from="64"
+          to="73">
+      <rel label="NK">
+        <span from="52"
+              to="63" />
+      </rel>
+    </span>
+    <span from="74"
+          to="77">
+      <rel label="SVP">
+        <span from="31"
+              to="35" />
+      </rel>
+    </span>
+    <span from="77"
+          to="78">
+      <rel label="--">
+        <span from="74"
+              to="77" />
+      </rel>
+    </span>
+    <span from="79"
+          to="84">
+      <rel label="CP">
+        <span from="124"
+              to="128" />
+      </rel>
+    </span>
+    <span from="85"
+          to="88">
+      <rel label="NK">
+        <span from="89"
+              to="96" />
+      </rel>
+    </span>
+    <span from="89"
+          to="96">
+      <rel label="SB">
+        <span from="124"
+              to="128" />
+      </rel>
+    </span>
+    <span from="97"
+          to="101">
+      <rel label="OA">
+        <span from="112"
+              to="123" />
+      </rel>
+    </span>
+    <span from="102"
+          to="111">
+      <rel label="NK">
+        <span from="97"
+              to="101" />
+      </rel>
+    </span>
+    <span from="112"
+          to="123">
+      <rel label="OC">
+        <span from="124"
+              to="128" />
+      </rel>
+    </span>
+    <span from="124"
+          to="128">
+      <rel label="MO">
+        <span from="31"
+              to="35" />
+      </rel>
+    </span>
+  </spanList>
+</layer>
diff --git a/t/index/corpus/doc/text/mate/morpho.xml b/t/index/corpus/doc/text/mate/morpho.xml
new file mode 100644
index 0000000..bf1a1a9
--- /dev/null
+++ b/t/index/corpus/doc/text/mate/morpho.xml
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?><?xml-model href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
+<layer docid="Corpus_Doc.0001" version="KorAP-0.4" xmlns="http://ids-mannheim.de/ns/KorAP">
+  <spanList>
+    <span from="0" id="s2_1" to="3">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">zu</f>
+	    <f name="pos">APPRART</f>
+	    <f name="msd">case=dat|number=sg|gender=neut</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="4" id="s2_2" to="11">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">letzter</f>
+	    <f name="pos">ADJA</f>
+	    <f name="msd">case=dat|number=sg|gender=neut|degree=pos</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="12" id="s2_3" to="23">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">kulturell</f>
+	    <f name="pos">ADJA</f>
+	    <f name="msd">case=gen|number=sg|gender=neut|degree=pos</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="24" id="s2_4" to="30">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">anlass</f>
+	    <f name="pos">NN</f>
+	    <f name="msd">case=gen|number=sg|gender=neut</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="31" id="s2_5" to="35">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">laden</f>
+	    <f name="pos">VVFIN</f>
+	    <f name="msd">number=sg|person=3|tense=pres|mood=ind</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="36" id="s2_6" to="39">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">der</f>
+	    <f name="pos">ART</f>
+	    <f name="msd">case=acc|number=sg|gender=fem</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="40" id="s2_7" to="47">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">leitung</f>
+	    <f name="pos">NN</f>
+	    <f name="msd">case=acc|number=sg|gender=fem</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="48" id="s2_8" to="51">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">der</f>
+	    <f name="pos">ART</f>
+	    <f name="msd">case=gen|number=sg|gender=neut</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="52" id="s2_9" to="63">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">schulheime</f>
+	    <f name="pos">NN</f>
+	    <f name="msd">case=gen|number=sg|gender=neut</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="64" id="s2_10" to="73">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">hofbergli</f>
+	    <f name="pos">NE</f>
+	    <f name="msd">case=nom|number=sg|gender=*</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="74" id="s2_11" to="77">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">ein</f>
+	    <f name="pos">PTKVZ</f>
+	    <f name="msd">_</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="77" id="s2_12" to="78">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">--</f>
+	    <f name="pos">$,</f>
+	    <f name="msd">_</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="79" id="s2_13" to="84">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">bevor</f>
+	    <f name="pos">KOUS</f>
+	    <f name="msd">_</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="85" id="s2_14" to="88">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">der</f>
+	    <f name="pos">ART</f>
+	    <f name="msd">case=nom|number=sg|gender=masc</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="89" id="s2_15" to="96">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">betrieb</f>
+	    <f name="pos">NN</f>
+	    <f name="msd">case=nom|number=sg|gender=masc</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="97" id="s2_16" to="101">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">ende</f>
+	    <f name="pos">NN</f>
+	    <f name="msd">case=*|number=sg|gender=neut</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="102" id="s2_17" to="111">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">schuljahr</f>
+	    <f name="pos">NN</f>
+	    <f name="msd">case=*|number=sg|gender=masc</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="112" id="s2_18" to="123">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">einstellen</f>
+	    <f name="pos">VVPP</f>
+	    <f name="msd">_</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+    <span from="124" id="s2_19" to="128">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+	<f name="lex">
+	  <fs>
+	    <f name="lemma">werden</f>
+	    <f name="pos">VAFIN</f>
+	    <f name="msd">number=sg|person=3|tense=pres|mood=ind</f>
+	  </fs>
+	</f>
+      </fs>
+    </span>
+  </spanList>
+</layer>
diff --git a/t/index/corpus/doc/text/struct/structure.xml b/t/index/corpus/doc/text/struct/structure.xml
new file mode 100644
index 0000000..2ef6178
--- /dev/null
+++ b/t/index/corpus/doc/text/struct/structure.xml
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
+
+<layer docid="A01_APR.13047" xmlns="http://ids-mannheim.de/ns/KorAP" version="KorAP-0.4">
+  <spanList>
+    <span id="s0" from="0" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">idsText</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="version">1.0</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s1" from="0" to="0">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">idsHeader</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="version">1.1</f>
+            <f name="status">new</f>
+            <f name="TEIform">teiHeader</f>
+            <f name="pattern">text</f>
+            <f name="type">text</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s2" from="0" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">text</f>
+      </fs>
+    </span>
+    <span id="s3" from="0" to="0">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">front</f>
+      </fs>
+    </span>
+    <span id="s4" from="0" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">body</f>
+      </fs>
+    </span>
+    <span id="s5" from="0" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">div</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="n">0</f>
+            <f name="type">Zeitung</f>
+            <f name="complete">y</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s6" from="0" to="31">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">head</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="type">main</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s7" from="0" to="31">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s8" from="32" to="42">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">byline</f>
+      </fs>
+    </span>
+    <span id="s9" from="32" to="42">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s10" from="43" to="633">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">div</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="n">1</f>
+            <f name="type">section</f>
+            <f name="complete">y</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s11" from="43" to="633">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">p</f>
+      </fs>
+    </span>
+    <span id="s12" from="43" to="172">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s13" from="173" to="364">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s14" from="365" to="477">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s15" from="478" to="633">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s16" from="634" to="1008">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">div</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="n">1</f>
+            <f name="type">section</f>
+            <f name="complete">y</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s17" from="634" to="658">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">head</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="type">cross</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s18" from="634" to="658">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s19" from="659" to="664">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">byline</f>
+      </fs>
+    </span>
+    <span id="s20" from="659" to="664">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s21" from="665" to="1008">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">p</f>
+      </fs>
+    </span>
+    <span id="s22" from="665" to="789">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s23" from="790" to="865">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s24" from="866" to="1008">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s25" from="1009" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">div</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="n">1</f>
+            <f name="type">section</f>
+            <f name="complete">y</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s26" from="1009" to="1036">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">head</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="type">cross</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s27" from="1009" to="1036">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s28" from="1037" to="1050">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">byline</f>
+      </fs>
+    </span>
+    <span id="s29" from="1037" to="1050">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s30" from="1051" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">p</f>
+      </fs>
+    </span>
+    <span id="s31" from="1051" to="1220">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s32" from="1221" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">s</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="broken">no</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span id="s33" from="1327" to="1327">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">back</f>
+      </fs>
+    </span>
+  </spanList>
+</layer>
diff --git a/t/index/corpus/doc/text/tree_tagger/morpho.xml b/t/index/corpus/doc/text/tree_tagger/morpho.xml
new file mode 100644
index 0000000..e229cec
--- /dev/null
+++ b/t/index/corpus/doc/text/tree_tagger/morpho.xml
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
+
+<layer docid="Corpus_Doc.0001" version="KorAP-0.4" xmlns="http://ids-mannheim.de/ns/KorAP">
+  <spanList>
+    <span from="0" id="s_7" to="3">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">zum</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">APPRART</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="4" id="s_8" to="11">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">letzt</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">ADJA</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="12" id="s_9" to="23">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">kulturell</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">ADJA</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="24" id="s_10" to="30">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">Anlaß</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">NN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="31" id="s_11" to="35">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">laden</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">VVFIN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="36" id="s_12" to="39">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">die</f>
+            <f name="certainty">0.997413</f>
+            <f name="ctag">ART</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="40" id="s_13" to="47">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">Leitung</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">NN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="48" id="s_14" to="51">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">die</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">ART</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="52" id="s_15" to="63">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">Schulheim</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">NN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="64" id="s_16" to="73">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">UNKNOWN</f>
+            <f name="certainty">0.912122</f>
+            <f name="ctag">NE</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="74" id="s_17" to="77">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">ein</f>
+            <f name="certainty">0.992479</f>
+            <f name="ctag">PTKVZ</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="77" id="s_18" to="78">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">,</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">$,</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="79" id="s_19" to="84">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">bevor</f>
+            <f name="certainty">0.999168</f>
+            <f name="ctag">KOUS</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="85" id="s_20" to="88">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">die</f>
+            <f name="certainty">0.999135</f>
+            <f name="ctag">ART</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="89" id="s_21" to="96">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">Betrieb</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">NN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="97" id="s_22" to="101">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">Ende</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">NN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="102" id="s_23" to="111">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">Schuljahr</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">NN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="112" id="s_24" to="123">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">einstellen</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">VVPP</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+    <span from="124" id="s_25" to="128">
+      <fs type="lex" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="lex">
+          <fs>
+            <f name="lemma">werden</f>
+            <f name="certainty">1.000000</f>
+            <f name="ctag">VAFIN</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
+  </spanList>
+</layer>
diff --git a/t/index/corpus/doc/text/tree_tagger/sentences.xml b/t/index/corpus/doc/text/tree_tagger/sentences.xml
new file mode 100644
index 0000000..cd2b00b
--- /dev/null
+++ b/t/index/corpus/doc/text/tree_tagger/sentences.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
+
+<layer xmlns="http://ids-mannheim.de/ns/KorAP" version="KorAP-0.4" docid="Corpus_Doc.0001">
+  <spanList>
+    <span from="0" to="130" />
+  </spanList>
+</layer>
diff --git a/t/index/glemm_morpho.t b/t/index/glemm_morpho.t
index 49157d5..650cecc 100644
--- a/t/index/glemm_morpho.t
+++ b/t/index/glemm_morpho.t
@@ -44,6 +44,7 @@
 
 is($data->{stream}->[0]->[2], 'glemm/l:__zu', 'Lemma');
 is($data->{stream}->[1]->[1], 'glemm/l:__letzt-', 'Lemma');
+
 is($data->{stream}->[3]->[1], 'glemm/l:_+an-', 'Lemma');
 is($data->{stream}->[3]->[2], 'glemm/l:_+lass', 'Lemma');
 is($data->{stream}->[3]->[3], 'glemm/l:__Anlass', 'Lemma');
diff --git a/t/index/mate_dependency.t b/t/index/mate_dependency.t
new file mode 100644
index 0000000..b4e4150
--- /dev/null
+++ b/t/index/mate_dependency.t
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+use Test::More skip_all => 'Not yet implemented';
+use Scalar::Util qw/weaken/;
+use Data::Dumper;
+
+use_ok('KorAP::Document');
+
+use File::Basename 'dirname';
+use File::Spec::Functions 'catdir';
+
+my $path = catdir(dirname(__FILE__), 'corpus', 'doc', 'text');
+
+ok(my $doc = KorAP::Document->new(
+  path => $path . '/'
+), 'Load Korap::Document');
+
+like($doc->path, qr!$path/$!, 'Path');
+ok($doc->parse, 'Parse document');
+
+ok($doc->primary->data, 'Primary data in existence');
+is($doc->primary->data_length, 129, 'Data length');
+
+use_ok('KorAP::Tokenizer');
+
+ok(my $tokens = KorAP::Tokenizer->new(
+  path => $doc->path,
+  doc => $doc,
+  foundry => 'OpenNLP',
+  layer => 'Tokens',
+  name => 'tokens'
+), 'New Tokenizer');
+
+ok($tokens->parse, 'Parse');
+
+ok($tokens->add('Mate', 'Dependency'), 'Add Structure');
+
+# my $data = $tokens->to_data->{data};
+
+done_testing;
+
+__END__
+
diff --git a/t/index/mate_morpho.t b/t/index/mate_morpho.t
new file mode 100644
index 0000000..16dde94
--- /dev/null
+++ b/t/index/mate_morpho.t
@@ -0,0 +1,62 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use Scalar::Util qw/weaken/;
+use Data::Dumper;
+
+use_ok('KorAP::Document');
+
+use File::Basename 'dirname';
+use File::Spec::Functions 'catdir';
+
+my $path = catdir(dirname(__FILE__), 'corpus', 'doc', 'text');
+
+ok(my $doc = KorAP::Document->new(
+  path => $path . '/'
+), 'Load Korap::Document');
+
+like($doc->path, qr!$path/$!, 'Path');
+ok($doc->parse, 'Parse document');
+
+ok($doc->primary->data, 'Primary data in existence');
+is($doc->primary->data_length, 129, 'Data length');
+
+use_ok('KorAP::Tokenizer');
+
+ok(my $tokens = KorAP::Tokenizer->new(
+  path => $doc->path,
+  doc => $doc,
+  foundry => 'OpenNLP',
+  layer => 'Tokens',
+  name => 'tokens'
+), 'New Tokenizer');
+
+ok($tokens->parse, 'Parse');
+
+ok($tokens->add('Mate', 'Morpho'), 'Add Structure');
+
+my $data = $tokens->to_data->{data};
+
+like($data->{foundries}, qr!mate/morpho!, 'data');
+like($data->{layerInfos}, qr!mate/p=tokens!, 'data');
+like($data->{layerInfos}, qr!mate/l=tokens!, 'data');
+like($data->{layerInfos}, qr!mate/m=tokens!, 'data');
+
+is($data->{stream}->[0]->[3], 'mate/l:zu', 'POS');
+is($data->{stream}->[0]->[4], 'mate/m:case:dat', 'POS');
+is($data->{stream}->[0]->[5], 'mate/m:gender:neut', 'POS');
+is($data->{stream}->[0]->[6], 'mate/m:number:sg', 'POS');
+is($data->{stream}->[0]->[7], 'mate/p:APPRART', 'POS');
+
+is($data->{stream}->[-1]->[2], 'mate/l:werden', 'POS');
+is($data->{stream}->[-1]->[3], 'mate/m:mood:ind', 'POS');
+is($data->{stream}->[-1]->[4], 'mate/m:number:sg', 'POS');
+is($data->{stream}->[-1]->[5], 'mate/m:person:3', 'POS');
+is($data->{stream}->[-1]->[6], 'mate/m:tense:pres', 'POS');
+is($data->{stream}->[-1]->[7], 'mate/p:VAFIN', 'POS');
+
+done_testing;
+
+__END__
diff --git a/t/index/mate_morpho_attr.t b/t/index/mate_morpho_attr.t
new file mode 100644
index 0000000..2833c4e
--- /dev/null
+++ b/t/index/mate_morpho_attr.t
@@ -0,0 +1,61 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use Scalar::Util qw/weaken/;
+use Data::Dumper;
+
+use_ok('KorAP::Document');
+
+use File::Basename 'dirname';
+use File::Spec::Functions 'catdir';
+
+my $path = catdir(dirname(__FILE__), 'corpus', 'doc', 'text');
+
+ok(my $doc = KorAP::Document->new(
+  path => $path . '/'
+), 'Load Korap::Document');
+
+like($doc->path, qr!$path/$!, 'Path');
+ok($doc->parse, 'Parse document');
+
+ok($doc->primary->data, 'Primary data in existence');
+is($doc->primary->data_length, 129, 'Data length');
+
+use_ok('KorAP::Tokenizer');
+
+ok(my $tokens = KorAP::Tokenizer->new(
+  path => $doc->path,
+  doc => $doc,
+  foundry => 'OpenNLP',
+  layer => 'Tokens',
+  name => 'tokens'
+), 'New Tokenizer');
+
+ok($tokens->parse, 'Parse');
+
+ok($tokens->add('Mate', 'MorphoAttr'), 'Add Structure');
+
+my $data = $tokens->to_data->{data};
+
+like($data->{foundries}, qr!mate/morphoattr!, 'data');
+like($data->{layerInfos}, qr!mate/p=tokens!, 'data');
+like($data->{layerInfos}, qr!mate/l=tokens!, 'data');
+
+is($data->{stream}->[0]->[1], '@:gender=neut$<b>16<s>1', 'POS');
+is($data->{stream}->[0]->[2], '@:number=sg$<b>16<s>1', 'POS');
+is($data->{stream}->[0]->[3], '@:case=dat$<b>16<s>1', 'POS');
+is($data->{stream}->[0]->[6], 'mate/l:zu', 'Lemmata');
+is($data->{stream}->[0]->[7], 'mate/p:APPRART$<b>128<s>1', 'POS');
+
+is($data->{stream}->[-1]->[0], '@:mood=ind$<b>16<s>1', 'POS');
+is($data->{stream}->[-1]->[1], '@:tense=pres$<b>16<s>1', 'POS');
+is($data->{stream}->[-1]->[2], '@:person=3$<b>16<s>1', 'POS');
+is($data->{stream}->[-1]->[3], '@:number=sg$<b>16<s>1', 'POS');
+is($data->{stream}->[-1]->[6], 'mate/l:werden', 'Lemmata');
+is($data->{stream}->[-1]->[7], 'mate/p:VAFIN$<b>128<s>1', 'POS');
+
+done_testing;
+
+__END__
diff --git a/t/index/tt_morpho.t b/t/index/tt_morpho.t
new file mode 100644
index 0000000..f2b31c9
--- /dev/null
+++ b/t/index/tt_morpho.t
@@ -0,0 +1,61 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use Scalar::Util qw/weaken/;
+use Data::Dumper;
+
+use_ok('KorAP::Document');
+
+use File::Basename 'dirname';
+use File::Spec::Functions 'catdir';
+
+my $path = catdir(dirname(__FILE__), 'corpus', 'doc', 'text');
+
+ok(my $doc = KorAP::Document->new(
+  path => $path . '/'
+), 'Load Korap::Document');
+
+like($doc->path, qr!$path/$!, 'Path');
+ok($doc->parse, 'Parse document');
+
+ok($doc->primary->data, 'Primary data in existence');
+is($doc->primary->data_length, 129, 'Data length');
+
+use_ok('KorAP::Tokenizer');
+
+ok(my $tokens = KorAP::Tokenizer->new(
+  path => $doc->path,
+  doc => $doc,
+  foundry => 'OpenNLP',
+  layer => 'Tokens',
+  name => 'tokens'
+), 'New Tokenizer');
+
+ok($tokens->parse, 'Parse');
+
+ok($tokens->add('TreeTagger', 'Morpho'), 'Add Structure');
+
+my $data = $tokens->to_data->{data};
+
+like($data->{foundries}, qr!treetagger/morpho!, 'data');
+like($data->{layerInfos}, qr!tt/p=tokens!, 'data');
+like($data->{layerInfos}, qr!tt/l=tokens!, 'data');
+
+is($data->{stream}->[0]->[4], 'tt/l:zum$<b>129<b>255', 'POS');
+is($data->{stream}->[0]->[5], 'tt/p:APPRART$<b>129<b>255', 'POS');
+
+is($data->{stream}->[3]->[3], 'tt/l:Anlaß$<b>129<b>255', 'POS');
+is($data->{stream}->[3]->[4], 'tt/p:NN$<b>129<b>255', 'POS');
+
+is($data->{stream}->[10]->[3], 'tt/l:ein$<b>129<b>253', 'POS');
+is($data->{stream}->[10]->[4], 'tt/p:PTKVZ$<b>129<b>253', 'POS');
+
+is($data->{stream}->[-1]->[3], 'tt/l:werden$<b>129<b>255', 'POS');
+is($data->{stream}->[-1]->[4], 'tt/p:VAFIN$<b>129<b>255', 'POS');
+
+done_testing;
+
+__END__
+
diff --git a/t/index/tt_sentences.t b/t/index/tt_sentences.t
new file mode 100644
index 0000000..3776197
--- /dev/null
+++ b/t/index/tt_sentences.t
@@ -0,0 +1,53 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use Scalar::Util qw/weaken/;
+use Data::Dumper;
+
+use_ok('KorAP::Document');
+
+use File::Basename 'dirname';
+use File::Spec::Functions 'catdir';
+
+my $path = catdir(dirname(__FILE__), 'corpus', 'doc', 'text');
+
+ok(my $doc = KorAP::Document->new(
+  path => $path . '/'
+), 'Load Korap::Document');
+
+like($doc->path, qr!$path/$!, 'Path');
+ok($doc->parse, 'Parse document');
+
+ok($doc->primary->data, 'Primary data in existence');
+is($doc->primary->data_length, 129, 'Data length');
+
+use_ok('KorAP::Tokenizer');
+
+ok(my $tokens = KorAP::Tokenizer->new(
+  path => $doc->path,
+  doc => $doc,
+  foundry => 'OpenNLP',
+  layer => 'Tokens',
+  name => 'tokens'
+), 'New Tokenizer');
+
+ok($tokens->parse, 'Parse');
+
+ok($tokens->add('TreeTagger', 'Sentences'), 'Add Structure');
+
+my $data = $tokens->to_data->{data};
+
+#diag Dumper $data;
+
+like($data->{foundries}, qr!treetagger/sentences!, 'data');
+is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens');
+is($data->{stream}->[0]->[1], '-:tt/sentences$<i>1', 'Number of paragraphs');
+is($data->{stream}->[0]->[2], '<>:tt/s:s$<b>64<i>0<i>130<i>17<b>0', 'Text');
+is($data->{stream}->[0]->[3], '_0$<i>0<i>3', 'Position');
+is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');
+
+done_testing;
+
+__END__