Commit a97fcab3 authored by Christos Christodoulopoulos's avatar Christos Christodoulopoulos
Browse files

Fixed a bug in gold mode regarding traces

When one of the two trees of the same annotation had a trace, the `predicateIndex` values where shifted resulting in a failed comparison.
parent 7ecf7121
No preview for this file type
......@@ -91,9 +91,19 @@ public class JBCorpus {
private boolean existsInList(List<JBDataStructure> annotationList, JBDataStructure otherAnnotation) {
for (JBDataStructure ann : annotationList) {
if (ann.getPredicateIndex() == otherAnnotation.getPredicateIndex()
&& ann.getType().equals(otherAnnotation.getType()))
if (!ann.getType().equals(otherAnnotation.getType())) continue;
if (ann.getPredicateIndex() == otherAnnotation.getPredicateIndex())
return true;
String annTree = ann.getTbTree().toTextTreeCompact();
String otherAnnTree = otherAnnotation.getTbTree().toTextTreeCompact();
// Special case: check for presence of traces
if (annTree.contains("*") || otherAnnTree.contains("*")) {
int countAnn = annTree.length() - annTree.replace("*", "").length();
int countOtherAnn = otherAnnTree.length() - otherAnnTree.replace("*", "").length();
// TODO: 2/4/16 This is potentially dangerous but should do for now
if (Math.abs(ann.getPredicateIndex() - otherAnnotation.getPredicateIndex()) == countAnn+countOtherAnn)
return true;
}
}
return false;
}
......
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