Fix missing column and last line
Change-Id: Ief7f85f792cff5e638063a46ec8ae63b5241f965
diff --git a/app/src/main/kotlin/de/ids_mannheim/korapxml2conllu/App.kt b/app/src/main/kotlin/de/ids_mannheim/korapxml2conllu/App.kt
index 0f905d3..e97dce2 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxml2conllu/App.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxml2conllu/App.kt
@@ -114,6 +114,7 @@
arrayOf(tokens, texts, sentences).forEach { map ->
map.remove(docId)
}
+ println()
}
}
@@ -137,9 +138,10 @@
feats: String = "_",
head: String = "_",
deprel: String = "_",
- deps: String = "_"
+ deps: String = "_",
+ misc: String = "_"
) {
- println("$token_index\t$token\t$lemma\t$upos\t$xpos\t$feats\t$head\t$deprel\t$deps")
+ println("$token_index\t$token\t$lemma\t$upos\t$xpos\t$feats\t$head\t$deprel\t$deps\t$misc")
}
private fun printTokenOffsetsInSentence(
sentences: ConcurrentHashMap<String, Array<Span>>,
@@ -152,7 +154,7 @@
var i = token_index
var start_offsets_string = ""
var end_offsets_string = ""
- while (i < tokens[docId]!!.size && tokens[docId]!![i].to < sentenceEndOffset) {
+ while (i < tokens[docId]!!.size && tokens[docId]!![i].to <= sentenceEndOffset) {
start_offsets_string += " " + tokens[docId]!![i].from
end_offsets_string += " " + tokens[docId]!![i].to
i++
@@ -196,6 +198,6 @@
fun main(args: Array<String?>?) {
System.setProperty("file.encoding", "UTF-8")
- println(App().main(args))
+ App().main(args)
}