diff --git a/src/org/exmaralda/common/corpusbuild/EXBBuilder.java b/src/org/exmaralda/common/corpusbuild/EXBBuilder.java index ac576629..ea92a4aa 100644 --- a/src/org/exmaralda/common/corpusbuild/EXBBuilder.java +++ b/src/org/exmaralda/common/corpusbuild/EXBBuilder.java @@ -8,7 +8,6 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -46,6 +45,7 @@ public class EXBBuilder { String segmentation = "default"; Set deleteMetaKeys = new HashSet<>(); + Map corpusMetadata = new HashMap<>(); public EXBBuilder(String corpusName, File topDirectory, String uniqueSpeakerDistinction, String segmentation){ @@ -59,6 +59,11 @@ public void setDeleteMetaKeys(Set deleteMetaKeys){ this.deleteMetaKeys = deleteMetaKeys; } + public void setCorpusMetadata(Set deleteMetaKeys){ + this.corpusMetadata = corpusMetadata; + } + + public void build() throws IOException, SAXException, JexmaraldaException, JDOMException, FSMException{ List exbFiles = collectEXBFiles(); segmentEXBFiles(exbFiles); @@ -120,6 +125,11 @@ private void constructComa(List exbFiles) throws SAXException, JexmaraldaE comaDocument.getRootElement().addContent(corpusDescriptionElement); corpusDescriptionElement.addContent(new Element("Key") .setAttribute("Name", "hzsk:corpusPrefix").setText(corpusName)); + for (String key : corpusMetadata.keySet()){ + corpusDescriptionElement.addContent(new Element("Key") + .setAttribute("Name", key).setText(corpusMetadata.get(key))); + + } for (File exbFile : exbFiles){