Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
berndmoos committed May 27, 2024
1 parent 451193b commit a542c07
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public void actionPerformed(ActionEvent e) {
dialog.duplicateTranscriptionTiersCheckBox.isSelected(),
dialog.orphanedAnnotationTiersCheckBox.isSelected(),
dialog.annotationMismatchesCheckBox.isSelected(),
dialog.temporalAnomaliesCheckBox.isSelected()
dialog.temporalAnomaliesCheckBox.isSelected(),
dialog.stratificationCheckBox.isSelected()
);

pbd = new ProgressBarDialog(coma, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.net.URISyntaxException;
import java.util.Hashtable;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.exmaralda.common.corpusbuild.AbstractCorpusChecker;
Expand All @@ -27,16 +28,26 @@ public class StructureErrorsChecker extends AbstractCorpusChecker {
boolean checkOrphanedAnnotationTiers = true;
boolean checkAnnotationMismatches = true;
boolean checkTemporalAnomalies = true;
boolean checkStratification = true;


public StructureErrorsChecker(boolean orphanedT, boolean duplicateT, boolean orphanedA, boolean aMismatch, boolean tAnomalie) {
public StructureErrorsChecker(boolean orphanedT, boolean duplicateT, boolean orphanedA, boolean aMismatch, boolean tAnomalie, boolean strat) {
checkOrphanedTranscriptionTiers = orphanedT;
checkDuplicateTranscriptionTiers = duplicateT;
checkOrphanedAnnotationTiers = orphanedA;
checkAnnotationMismatches = aMismatch;
checkTemporalAnomalies = tAnomalie;
checkStratification = strat;
}

public StructureErrorsChecker(boolean orphanedT, boolean duplicateT, boolean orphanedA, boolean aMismatch, boolean tAnomalie) {
checkOrphanedTranscriptionTiers = orphanedT;
checkDuplicateTranscriptionTiers = duplicateT;
checkOrphanedAnnotationTiers = orphanedA;
checkAnnotationMismatches = aMismatch;
checkTemporalAnomalies = tAnomalie;
checkStratification = false;
}


@Override
Expand Down Expand Up @@ -92,6 +103,15 @@ public void processTranscription(BasicTranscription bt, String currentFilename)
addError(currentFilename, "", tliID, text);
}
}

if (checkStratification){
List<String> nonStratifiedTiers = bt.getBody().getNonStratifiedTiers();
String text = "Tier is not stratified";
for (String tierID : nonStratifiedTiers){
addError(currentFilename, tierID, "", text);
}

}


}
Expand Down
11 changes: 11 additions & 0 deletions src/org/exmaralda/partitureditor/jexmaralda/BasicBody.java
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,18 @@ public void stratify(short method){
}
}
}
}
}

public List<String> getNonStratifiedTiers(){
List<String> result = new ArrayList<>();
for (int pos=0; pos<getNumberOfTiers(); pos++){
Tier t = getTierAt(pos);
if (!t.isStratified(getCommonTimeline())){
result.add(t.getID());
}
}
return result;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
Expand All @@ -32,13 +33,13 @@

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
<Property name="columns" type="int" value="1"/>
<Property name="rows" type="int" value="5"/>
<Property name="rows" type="int" value="6"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="orphanedTranscriptionTiersCheckBox">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Orphaned transcription tiers"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;b&gt;Orphaned transcription tiers&lt;/b&gt; - Transcription tiers without a speaker&lt;/html&gt;"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
Expand All @@ -47,8 +48,7 @@
<Component class="javax.swing.JCheckBox" name="duplicateTranscriptionTiersCheckBox">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Duplicate transcription tiers"/>
<Property name="actionCommand" type="java.lang.String" value="Duplicate transcription tiers"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;b&gt;Duplicate transcription tiers&lt;/b&gt; - Two or more transcription tiers with the same speaker&lt;/html&gt;"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
Expand All @@ -57,7 +57,7 @@
<Component class="javax.swing.JCheckBox" name="orphanedAnnotationTiersCheckBox">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Orphaned annotation tiers"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;b&gt;Orphaned annotation tiers&lt;/b&gt; - Annotation tiers without a transcription tier with the same speaker&lt;/html&gt;"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
Expand All @@ -66,7 +66,7 @@
<Component class="javax.swing.JCheckBox" name="annotationMismatchesCheckBox">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Annotation mismatches"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;b&gt;Annotation mismatches&lt;/b&gt; - Annotations without a matching sequence of events in the corresponding transcription tier&lt;/html&gt;"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
Expand All @@ -75,7 +75,16 @@
<Component class="javax.swing.JCheckBox" name="temporalAnomaliesCheckBox">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Temporal anomalies"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;b&gt;Temporal anomalies&lt;/b&gt; - Absolute time values in the timeline not making sense&lt;/html&gt;"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
<Component class="javax.swing.JCheckBox" name="stratificationCheckBox">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&lt;b&gt;Stratification&lt;/b&gt; - Overlapping events within a tier&lt;/html&gt;"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,39 @@ private void initComponents() {
orphanedAnnotationTiersCheckBox = new javax.swing.JCheckBox();
annotationMismatchesCheckBox = new javax.swing.JCheckBox();
temporalAnomaliesCheckBox = new javax.swing.JCheckBox();
stratificationCheckBox = new javax.swing.JCheckBox();
jPanel1 = new javax.swing.JPanel();
okButton = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Structure checks");

mainPanel.setLayout(new java.awt.GridLayout(5, 1));
mainPanel.setLayout(new java.awt.GridLayout(6, 1));

orphanedTranscriptionTiersCheckBox.setSelected(true);
orphanedTranscriptionTiersCheckBox.setText("Orphaned transcription tiers");
orphanedTranscriptionTiersCheckBox.setText("<html><b>Orphaned transcription tiers</b> - Transcription tiers without a speaker</html>");
mainPanel.add(orphanedTranscriptionTiersCheckBox);

duplicateTranscriptionTiersCheckBox.setSelected(true);
duplicateTranscriptionTiersCheckBox.setText("Duplicate transcription tiers");
duplicateTranscriptionTiersCheckBox.setActionCommand("Duplicate transcription tiers");
duplicateTranscriptionTiersCheckBox.setText("<html><b>Duplicate transcription tiers</b> - Two or more transcription tiers with the same speaker</html>");
mainPanel.add(duplicateTranscriptionTiersCheckBox);

orphanedAnnotationTiersCheckBox.setSelected(true);
orphanedAnnotationTiersCheckBox.setText("Orphaned annotation tiers");
orphanedAnnotationTiersCheckBox.setText("<html><b>Orphaned annotation tiers</b> - Annotation tiers without a transcription tier with the same speaker</html>");
mainPanel.add(orphanedAnnotationTiersCheckBox);

annotationMismatchesCheckBox.setSelected(true);
annotationMismatchesCheckBox.setText("Annotation mismatches");
annotationMismatchesCheckBox.setText("<html><b>Annotation mismatches</b> - Annotations without a matching sequence of events in the corresponding transcription tier</html>");
mainPanel.add(annotationMismatchesCheckBox);

temporalAnomaliesCheckBox.setSelected(true);
temporalAnomaliesCheckBox.setText("Temporal anomalies");
temporalAnomaliesCheckBox.setText("<html><b>Temporal anomalies</b> - Absolute time values in the timeline not making sense</html>");
mainPanel.add(temporalAnomaliesCheckBox);

stratificationCheckBox.setSelected(true);
stratificationCheckBox.setText("<html><b>Stratification</b> - Overlapping events within a tier</html>");
mainPanel.add(stratificationCheckBox);

getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);

okButton.setText("OK");
Expand Down Expand Up @@ -111,6 +115,7 @@ public void windowClosing(java.awt.event.WindowEvent e) {
private javax.swing.JButton okButton;
public javax.swing.JCheckBox orphanedAnnotationTiersCheckBox;
public javax.swing.JCheckBox orphanedTranscriptionTiersCheckBox;
public javax.swing.JCheckBox stratificationCheckBox;
public javax.swing.JCheckBox temporalAnomaliesCheckBox;
// End of variables declaration//GEN-END:variables

Expand Down

0 comments on commit a542c07

Please sign in to comment.