While working on further bug reports/fixes for SelectFS, I also started looking
into cases where coveredBy is used with includeAnnotationsWithEndBeyondBounds.
This brought up that the last version of the annotation predicate definition
had problem with two overlapping cases:
T6: X:[0,3] Y[0,2]
T7: X:[0,3] Y[1,3]
In T6, X starts at the beginning of Y and ends after the end of Y.
So "X is overlapping Y at the end". However, this "overlapping-at-end" was
false in the last version of the annotation predicates.
Similarly, in T7, X starts before the beginning of Y and ends at the end of Y.
So "X is overlapping Y at the beginning". However, this "overlapping-at-begin"
was
also false in the last version of the annotation predicates.
But looking into the "includeAnnotationsWithEndBeyondBounds", I strongly believe
that
(cas, type, y) -> cas.<Annotation>select(type)
.coveredBy(y)
.includeAnnotationsWithEndBeyondBounds()
.map(x -> (AnnotationFS) x)
.collect(toList()))
should be equivalent to
(cas, type, y) -> cas.getAnnotationIndex(type).select()
.filter(x -> x != y && (coveredBy(x, y) || overlappingAtEnd(x, y)))
.collect(toList())
So I adjusted T6 and T7 to include the left/right overlapping cases and also
adjusted the underlying implementation accordingly. It had no apparent effect
on test cases other than the test cases which specifically check that the
predicate implementation matches the annotation predicate specification matrix.
Cheers,
-- Richard