Skip to content
Snippets Groups Projects
Commit 2048e73d authored by Lange, Dr. Herbert's avatar Lange, Dr. Herbert
Browse files

update variable name

parent 65e6c15a
No related branches found
No related tags found
Loading
...@@ -20,8 +20,9 @@ public class EXMARaLDATierFinder extends TierFinder { ...@@ -20,8 +20,9 @@ public class EXMARaLDATierFinder extends TierFinder {
public EXMARaLDATierFinder(Properties properties) { public EXMARaLDATierFinder(Properties properties) {
super(properties); super(properties);
if (attribute == null || attribute.isEmpty()) { // Use default attribute
attribute = "id"; if (attribute_name == null || attribute_name.isEmpty()) {
attribute_name = "id";
} }
} }
...@@ -44,16 +45,16 @@ public class EXMARaLDATierFinder extends TierFinder { ...@@ -44,16 +45,16 @@ public class EXMARaLDATierFinder extends TierFinder {
List<String> tierIds = new ArrayList<>(); List<String> tierIds = new ArrayList<>();
if (cd instanceof EXMARaLDATranscriptionData) { if (cd instanceof EXMARaLDATranscriptionData) {
Document dom = ((EXMARaLDATranscriptionData) cd).getJdom(); Document dom = ((EXMARaLDATranscriptionData) cd).getJdom();
tierIds.addAll(((List<Attribute>) Collections.checkedList(XPath.newInstance( String xpath = String.format("//tier[contains(@%s,\"%s\")]/@id",
String.format("//tier[contains(@%s,\"%s\")]/@id", attribute_name, pattern);
attribute, pattern)).selectNodes(dom), Attribute.class)) tierIds.addAll(((List<Attribute>) Collections.checkedList(XPath.newInstance(xpath).selectNodes(dom), Attribute.class))
.stream().map(Attribute::getValue).collect(Collectors.toList())); .stream().map(Attribute::getValue).collect(Collectors.toList()));
} }
else if (cd instanceof EXMARaLDASegmentedTranscriptionData) { else if (cd instanceof EXMARaLDASegmentedTranscriptionData) {
Document dom = ((EXMARaLDASegmentedTranscriptionData) cd).getJdom(); Document dom = ((EXMARaLDASegmentedTranscriptionData) cd).getJdom();
tierIds.addAll(((List<Attribute>) Collections.checkedList(XPath.newInstance( tierIds.addAll(((List<Attribute>) Collections.checkedList(XPath.newInstance(
String.format("//segmented-tier[contains(@%s,\"%s\")]/@id", String.format("//segmented-tier[contains(@%s,\"%s\")]/@id",
attribute, pattern)).selectNodes(dom), Attribute.class)) attribute_name, pattern)).selectNodes(dom), Attribute.class))
.stream().map(Attribute::getValue).collect(Collectors.toList())); .stream().map(Attribute::getValue).collect(Collectors.toList()));
} }
// Add found tiers to frequency list // Add found tiers to frequency list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment