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

implement function

parent ff7098e2
No related branches found
No related tags found
1 merge request!6add feature to load criteria file from resource and place all criteria files...
package de.uni_hamburg.corpora.validation.quest;
import de.uni_hamburg.corpora.CorpusData;
import de.uni_hamburg.corpora.EXMARaLDATranscriptionData;
import de.uni_hamburg.corpora.EXMARaLDASegmentedTranscriptionData;
import de.uni_hamburg.corpora.*;
import de.uni_hamburg.corpora.utilities.quest.XMLTools;
import org.exmaralda.partitureditor.fsm.FSMException;
import org.exmaralda.partitureditor.jexmaralda.JexmaraldaException;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.xpath.XPath;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.xpath.XPathExpressionException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -18,6 +25,26 @@ public class EXMARaLDAAnnotationChecker extends AnnotationChecker {
super(properties);
}
@Override
public Report function(Corpus c, Boolean fix) throws NoSuchAlgorithmException, ClassNotFoundException, FSMException, URISyntaxException, SAXException, IOException, ParserConfigurationException, JexmaraldaException, TransformerException, XPathExpressionException, JDOMException {
Report report = new Report();
// Check if we have a tier pattern. if yes we use the tier finder to get all tier ids
if (props.containsKey("annotation-tier-pattern")) {
// Copy old properties
Properties newProperties = new Properties();
newProperties.putAll(props);
// convert tier pattern
newProperties.put("tier-pattern", props.getProperty("annotation-tier-pattern"));
// run tier finder
EXMARaLDATierFinder etf = new EXMARaLDATierFinder(newProperties);
report.merge(etf.function(c, fix));
tierIds.addAll(etf.getTierList());
setUp = true;
}
report.merge(super.function(c, fix));
return report;
}
@Override
public String getDescription() {
return "Either checks the annotation in a list of tiers or generates statistics about the tags used in an " +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment