Hi all, I am looking into introducing a set of predicates that can be used to compare the relative position of two annotations to each other. These should then allow e.g. to filter for overlapping (left/right) annotations and so on. Also, I want then to check that the SelectFS API behavior is consistent with these predicates. Envisioned use-cases:
AnnotationPredicates.coveredBy(token, sentence) -> true/false or eventually token.coveredBy(sentence) -> true/false Mind that these predicates do not aim to provide a fast way of filtering through an annotation index - that would rather be a job for optimised selectors in the UIMAv3 SelectFS API and/or in the uimaFIT (J)CasUtil.select* methods. I have set up a Google Doc to discuss this. The first sheet lists some thoughts into how the behavior of the predicates should be in general and then the definition of the different types of relations. The second sheet in the doc lists all cases I have been able to come up with and whether or not the various predicates would return true or false in a given case. https://docs.google.com/spreadsheets/d/1fgMbqVlxwJSBNui7Y_phtRYEhzr_rfXQ5ZUREH1-nwI/edit#gid=0 I'd be very curious if anybody has feedback on this. In particular the zero-width cases appear to be a bit tricky. I believe the draft I made makes a lot of sense, but there may be different perspectives on this that I'd like to hear. Cheers, -- Richard P.S.: While working on this, I am already stumbling over a few clear bugs in the SelectFS API (e.g. https://issues.apache.org/jira/browse/UIMA-6282). I also note that some relations (e.g. left overlapping / right overlapping) are not easily optimizable via the SelectFS API so far.
