Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
berndmoos committed Dec 12, 2024
1 parent f98e314 commit d496398
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/org/exmaralda/common/corpusbuild/EXBBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,6 +45,7 @@ public class EXBBuilder {
String segmentation = "default";

Set<String> deleteMetaKeys = new HashSet<>();
Map<String, String> corpusMetadata = new HashMap<>();


public EXBBuilder(String corpusName, File topDirectory, String uniqueSpeakerDistinction, String segmentation){
Expand All @@ -59,6 +59,11 @@ public void setDeleteMetaKeys(Set<String> deleteMetaKeys){
this.deleteMetaKeys = deleteMetaKeys;
}

public void setCorpusMetadata(Set<String> deleteMetaKeys){
this.corpusMetadata = corpusMetadata;
}


public void build() throws IOException, SAXException, JexmaraldaException, JDOMException, FSMException{
List<File> exbFiles = collectEXBFiles();
segmentEXBFiles(exbFiles);
Expand Down Expand Up @@ -120,6 +125,11 @@ private void constructComa(List<File> 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){
Expand Down

0 comments on commit d496398

Please sign in to comment.