I am attaching a patch with a series of selectIntersects and indexIntersects methods. There's more signatures than the corresponding selectCovered/Covering methods, as "intersects" could include covering annotations or not. If they are excluded, the methods use the same approach you used in selecCovered, advancing the iterator. Otherwise, they defer to the int interval method used in selectCovering.
Cool, I'll look into ti and let you know if I manage to make something useful. Thanks for the tips.On Sun Jan 25 2015 at 12:47:52 PM Richard Eckart de Castilho <firstname.lastname@example.org> wrote:Hi José,
we had no need for such a method so far ;) The easiest way would probably be to copy the
selectCovering method from uimaFIT and adjust it to catch all intersecting annotations.
You can probably add an optimization to a selectIntersecting method which breaks the loop as soon as the begin offset of an annotation is larger than the end offset of your intersection range.
On 24.01.2015, at 22:25, José Tomás Atria <email@example.com> wrote:
> Hello all,
> I am looking for the best approach to select all annotations of a given
> type that intersect an annotation of a different type.
> I am aware of selectCovered and selectCovering, which, as far as I
> understand, will select all annotations (of a given type) that cover ranges
> of text which are, respectively, subsets or supersets of another
> annotation. Is there a similar method for annotations that cover ranges
> which merely _intersect_ with the range covered by a given annotation?
> What would the recommended way of achieving this?
> Any help would be apreciated. Thanks!
> entia non sunt multiplicanda praeter necessitatem