Skip to content

Commit

Permalink
Allow to not map speaker metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskrause committed Dec 3, 2018
1 parent 1f02664 commit a1ada44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Expand Up @@ -172,9 +172,11 @@ public DOCUMENT_STATUS mapSDocument() {
this.mapMetaInformation2SDocument(basicTranscription, getDocument());
}
// mapping the speakers object
for (Speaker speaker : basicTranscription.getSpeakertable()) {
// map all speaker objects
this.mapSpeaker2SMetaAnnotation(speaker, getDocument());
if(getProps().isMapSpeakerMetadata()) {
for (Speaker speaker : basicTranscription.getSpeakertable()) {
// map all speaker objects
this.mapSpeaker2SMetaAnnotation(speaker, getDocument());
}
}
// remember the original order of the tiers
List<String> tierDisplayNames = new LinkedList<>();
Expand Down Expand Up @@ -541,7 +543,7 @@ public void computeTierCollection() {
private void mapTiers2SNodes(List<Tier> slot) {
for (Tier tier : slot) {

if(getProps().isIgnoreDescription() && tier.getType() == TIER_TYPE.D) {
if(tier.getType() == TIER_TYPE.D && !getProps().isMapDescriptions()) {
continue;
}

Expand Down
Expand Up @@ -58,7 +58,8 @@ public class EXMARaLDAImporterProperties extends PepperModuleProperties {
public static final String PROP_TRIM_EVENTS = "trimEvents";
public static final String PROP_PARSE_NAMESPACE = "parseNamespace";
public static final String PROP_MAP_TIMELINE = "mapTimeline";
public static final String PROP_IGNORE_DESCRIPTION = "ignoreDescription";
public static final String PROP_MAP_DESCRIPTIONS = "mapDescriptions";
public static final String PROP_MAP_SPEAKER_METADATA = "mapSpeakerMetadata";


public EXMARaLDAImporterProperties() {
Expand All @@ -75,7 +76,8 @@ public EXMARaLDAImporterProperties() {
this.addProperty(new PepperModuleProperty<Boolean>(PROP_TRIM_EVENTS, Boolean.class, "When this property is true, all events in exmaralda are trimmed before they are mapped to Salt. That means for instance trailing blanks are removed. ", false, false));
this.addProperty(new PepperModuleProperty<Boolean>(PROP_PARSE_NAMESPACE, Boolean.class, "Parse the qualified annotation name including the namespace (e.g. myns::annoname) from the category name.", false, false));
this.addProperty(new PepperModuleProperty<Boolean>(PROP_MAP_TIMELINE, Boolean.class, "Import the EXMARaLDA timeline as Salt STimeline", true, false));
this.addProperty(new PepperModuleProperty<Boolean>(PROP_IGNORE_DESCRIPTION, Boolean.class, "Ignore all tiers of the type \"Description\"", false, false));
this.addProperty(PepperModuleProperty.create().withName(PROP_MAP_DESCRIPTIONS).withType(Boolean.class).withDescription("Map tiers of the type \\\"Description\\\"").withDefaultValue(true).build());
this.addProperty(PepperModuleProperty.create().withName(PROP_MAP_SPEAKER_METADATA).withType(Boolean.class).withDescription("Import the metadata of the speaker").withDefaultValue(true).build());
}

@Deprecated
Expand Down Expand Up @@ -136,8 +138,12 @@ public Boolean isMapTimeline() {
return ((Boolean) this.getProperty(PROP_MAP_TIMELINE).getValue());
}

public Boolean isIgnoreDescription() {
return ((Boolean) this.getProperty(PROP_IGNORE_DESCRIPTION).getValue());
public Boolean isMapDescriptions() {
return ((Boolean) this.getProperty(PROP_MAP_DESCRIPTIONS).getValue());
}

public Boolean isMapSpeakerMetadata() {
return ((Boolean) this.getProperty(PROP_MAP_SPEAKER_METADATA).getValue());
}


Expand Down

0 comments on commit a1ada44

Please sign in to comment.