[
https://issues.apache.org/jira/browse/UIMA-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13643320#comment-13643320
]
Richard Eckart de Castilho commented on UIMA-2830:
--------------------------------------------------
This is related to https://code.google.com/p/uimafit/issues/detail?id=61 :
{quote}
As far as I can tell from FSIndexRepositoryImpl.getAllIndexedFS(Type,
List<FSIterator<FeatureStructure>>), the index repository is scanned for some
index for the specified type:
1) if a auto-generated index is present, that is used (auto-generated means,
the user did not explicitly generate one)
2) if the user did generate an index or of the type is an annotation type (UIMA
always generates a sorted index for those), it looks first for some sorted index
3) if no sorted index could be found, it tries a bag index, then a set index.
>From the index found by the above procedure, all FSes of the specified type
>and its subtypes are extracted.
For most cases this should work well. If a user creates multiple custom indexes
and adds FSes to some, but not to others, strange things might happen. When
uimaFIT has better support for custom indexes, we should probably add some test
cases in this department, in particular for the methods like CasUtil.selectFS()
or JCasUtil.select() in combination with custom indexes.
{quote}
> Expose FSIterator via (J)CasUtil.select*() methods where applicable
> -------------------------------------------------------------------
>
> Key: UIMA-2830
> URL: https://issues.apache.org/jira/browse/UIMA-2830
> Project: UIMA
> Issue Type: Improvement
> Components: uimaFIT
> Reporter: Richard Eckart de Castilho
> Assignee: Richard Eckart de Castilho
> Priority: Minor
> Fix For: 2.0.0uimaFIT
>
>
> Some of the uimaFIT (J)CasUtil "select" methods work directly on an FSIndex
> or FSIterator. In those cases, it would be nice if the methods didn't just
> return a Collection, but some FSCollection<T> in which the iterator() method
> returns an FSIterator<T>.
> At least in those cases were an AnnotationIndex is used, it would be possible
> to actually return something that implements Collection<T> and FSIndex<T>, so
> it can be used in constructors like new ArrayList(...), in modern-style for
> loops, and for type-save access to the index.
> In those cases were an FSIterator is used because the type searched for is
> not an annotation, the FSIndex<T> interface is not a good choice, because it
> contains several methods that cannot be implemented based only on FSIterator.
> So maybe two interfaces: FSCollection<T> based on FSIterator and
> AnnotationCollection<T> based on FSIndex/AnnotationIndex.
> This mainly exposes more details of UIMA AnnotationIndex via CasUtil.
> JCasUtil's select method doesn't make a different between FSes that inherit
> from AnnotationFS or not. Here, the only benefit is getting access to an
> FSIterator.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira