Commit 462a9447 authored by Christos Christodoulopoulos's avatar Christos Christodoulopoulos
Browse files

Allow for flexible predicate matching (gold mode)

Useful for when one of the annotators has inserted (up to 2) extra nodes in the tree, moving the position/index of the predicates
parent 21f0acd3
No preview for this file type
......@@ -459,8 +459,10 @@ public class JBToolkit extends JFrame implements ActionListener, ItemListener, L
List<JBDataStructure> otherAnnotations = otherCorpus.getAnnotationsFromContext(annotation.getIndexInContext());
if (otherAnnotations == null) return null;
for (JBDataStructure otherAnnotation : otherAnnotations) {
if (otherAnnotation.getPredicateIndex() == annotation.getPredicateIndex() &&
otherAnnotation.getType().equals(annotation.getType()))
int indexDiff = Math.abs(otherAnnotation.getPredicateIndex() - annotation.getPredicateIndex());
// Allow for +/- 2 difference in indices due to the insertion of empty nodes
// (and other noise from the CHAT version of the data
if (indexDiff < 3 && otherAnnotation.getType().equals(annotation.getType()))
return otherAnnotation;
}
return null;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment