You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Marshall Schor <ms...@schor.com> on 2007/08/14 13:13:46 UTC
Re: Unambiguous filtered iterator
I think this thread was never responded to - can we discuss now? or am I
mistaken?
-Marshall
Adam Lally wrote:
> I got a user request for an unambiguous, filtered iterator that
> filters first, then applies the unambiguousness constraint. (An
> unambiguous iterator is one where the next annotation returned is
> guaranteed not to overlap with the previous annotation returned.)
>
> It seems easy to do this: all we need to do is create a new instance
> of the Subiterator class using new Subiterator(filteredIter), where
> filteredIter is the filtered iterator. Users can't call this directly
> since Subiterator is package-private.
>
> What would be a good public API for this? Two ideas are:
>
> static CAS.createUnambiguousIterator(Iterator iter)
> static AnnotationIndex.createUnambiguousIterator(Iterator iter)
>
>
> These are analogous to CAS.createFilteredIterator(Iterator iter).
> However for unambiguous iterators, the Iterator must be an iterator
> over the Annotation index, not some user-defined index.. So perhaps
> making this a static method of AnnotationIndex is more clear.
>
> Thoughts?
>
> -Adam
>
>