Fix foundry in output zip file name

Change-Id: Ia217fd3f99c916933c8d31bcfa22c914003394dd
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 8eef239..694fbf2 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXml2Conllu.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXml2Conllu.kt
@@ -336,10 +336,17 @@
     private fun processZipFile(zipFilePath: String, foundry: String = "base") {
         LOGGER.info("Processing ${zipFilePath} in thread ${Thread.currentThread().id}")
         if (outputFormat == OutputFormat.KORAPXML && dbFactory == null) {
+            var targetFoundry = "base"
+            if (taggerName != null) {
+                val tagger = AnnotationToolBridgeFactory.getAnnotationToolBridge(taggerName!!, taggerModel!!, LOGGER) as TaggerToolBridge?
+                if (tagger != null) {
+                    targetFoundry = tagger.foundry
+                }
+            }
             dbFactory = DocumentBuilderFactory.newInstance()
             dBuilder = dbFactory!!.newDocumentBuilder()
             val outputMorphoZipFileName =
-                zipFilePath.replace(Regex("\\.zip$"), ".".plus(getMorphoFoundry()).plus(".zip"))
+                zipFilePath.replace(Regex("\\.zip$"), ".".plus(targetFoundry).plus(".zip"))
             if (File(outputMorphoZipFileName).exists() && !overwrite) {
                 LOGGER.severe("Output file $outputMorphoZipFileName already exists. Use --overwrite to overwrite.")
                 exitProcess(1)