[
https://issues.apache.org/jira/browse/UIMA-6160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16985430#comment-16985430
]
Marshall Schor commented on UIMA-6160:
--------------------------------------
Thanks for reporting; I'll clarify the documentation.
The startAt works for *any* sorted indexes, of which Annotations are a subtype;
you can define other indexes which are sorted over other features.
The startAt does an iterator.moveTo(...) operation, which is defined as
* moving to left-most "equal" using the comparator defined for the index
* or, if no element is "equal" using the comparator, move to the position of
the first item in the index that is greater than the argument (again, using the
comparator).
Left-most : this means if there are many FSs with the same compare-value, the
iterator keeps moving backwards until it gets to one < argument, and then
reverses, so it's on the "left-most" one of the equal values.
For Annotations, when iterators are created (under the covers) by the select
operations, they can be made to use comparators which ignore or don't ignore
typePriorities. The default for select operators is to ignore type priorities.
For Annotation indexes, if the argument is a Token at position, say, begin=10,
end = 20, and if there is are annotations starting at 10 and ending at 20, this
will go to the left-most one, so it will be positioned to retrieve an element
ending at 20.
Does that answer the question, or have I misunderstood something?
> Single int arg version of select.startAt()?
> -------------------------------------------
>
> Key: UIMA-6160
> URL: https://issues.apache.org/jira/browse/UIMA-6160
> Project: UIMA
> Issue Type: Improvement
> Components: UIMA
> Affects Versions: 3.1.1SDK
> Reporter: Richard Eckart de Castilho
> Priority: Major
>
> If one wants to start looking for a particular annotation at a given
> character position, then I think it would be convenient to be able to say
> "select(Token.class).startAt(offset)", instead of having to say
> "select(Token.class).startAt(offset, offset)".
> What is not clear to me from reading the documentation is whether a Token
> which *ends* at offset would be returned or not.
> Another special case which is not clear by the documentation is whether a
> Token which *starts and ends* at offset would be returned.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)