Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Workaround
-
3.1.1SDK
-
None
-
None
Description
The following code does not compile because select.covering() uses TOP instead of AnnotationFS as the generic type. Consequently, getBegin() and getEnd() are not available on the "s" used in the filter expressions. But since covering() only makes sense for annotations, binding the generic type to TOP doesn't seem to make much sense:
return aCas.select(getType(aCas, Sentence.class)).covering(aBegin1, aBegin1)
.filter(s -> s.getBegin() <= aBegin1 && aBegin1 < s.getEnd())
.filter(s -> s.getBegin() <= aBegin2 && aBegin2 < s.getEnd()).findFirst()
.isPresent();