Don't wait for text that are already emitted to krill.tar

Change-Id: Id0158cf19f366781a9efdc88826c2aa4da53ce85
diff --git a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
index adb1fec..5347597 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
@@ -2073,9 +2073,12 @@
 
                 LOGGER.fine("Checking if ready to process $docId: texts=${texts[docId] != null}, sentences=${sentences[docId] != null}, tokens=${tokens[docId] != null}, morpho=${morpho[docId] != null}, morphoRequired=$morphoRequired, textRequired=$textRequired")
 
+                // Only check readiness if text hasn't been output yet
+                // This prevents checking texts that were output and had their data cleared
                 if ((texts[docId] != null || !textRequired) && sentences[docId] != null && tokens[docId] != null
                     && (!morphoRequired || morpho[docId] != null)
                     && (extractMetadataRegex.isEmpty() || metadata[docId] != null)
+                    && !outputTexts.contains(docId)  // Skip if already output
                 ) {
                     LOGGER.fine("All data ready for $docId, calling processText")
                     processText(docId, foundry)
@@ -2128,6 +2131,7 @@
                     }
                     if ((texts[docId] != null || !textRequired) && sentences[docId] != null && tokens[docId] != null
                         && (!morphoRequired || morpho[docId] != null)
+                        && !outputTexts.contains(docId)  // Skip if already output
                     ) {
                         LOGGER.info("Processing text (meta-ready): $docId in thread ${Thread.currentThread().threadId()}")
                         processText(docId, foundry)