Catch sentence indices out of bounds like in v0

Change-Id: I27ee856890af1bc6604c0f32e3172fa2404a90e4
diff --git a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXml2Conllu.kt b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXml2Conllu.kt
index 01ebd58..763ecaf 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXml2Conllu.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXml2Conllu.kt
@@ -504,7 +504,10 @@
                 }
                 if (morpho[docId]?.containsKey("${span.from}-${span.to}") == true) {
                     val mfs = morpho[docId]!!["${span.from}-${span.to}"]
-
+                    if (span.to > texts[docId]!!.length) {
+                        span.to = texts[docId]!!.length
+                        LOGGER.warning("Offset error: could not retrieve token at ${span.from}-${span.to} – ending with: ${texts[docId]!!.substring(span.from, span.to)}")
+                    }
                     output.append(
                         printConlluToken(
                             token_index,