Hi Jerome, Why not using FilteredIterator (which extends FSIteratorImplBase) ? Using the FSMatchConstraint interface you can then define your own constraint. Hope this helps. Tommaso
2010/1/11 Jérôme Rocheteau <[email protected]> > Hi everybody, > > I would like to apply several constraint filters to an annotation iterator > and, > especially, to select annotations which covered text matches a given text. > So I'm thinking of defining a method that iterates and removes annotations > which covered text doesn't match the given text from a > FSIterator<Annotation>. > > However, an exception UnsupportedOperationException occurs while calling > the > remove method (because of its definition in the FSIteratorImpl class, I > guess). > > So I would like to know how to (un)select annotations of such an object: > * either by implementing the remove method of the FSIteratorImpl class, > * or by casting a java.util.Iterator<E> to > org.apache.uima.cas.FSIterator<E>, > * or by building such an iterator from annotation lists, > * or something else. > > Do you have any hints? > > Thanks in advance, > Jérôme >
