[
https://issues.apache.org/jira/browse/UIMA-6284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17218797#comment-17218797
]
Richard Eckart de Castilho edited comment on UIMA-6284 at 10/22/20, 6:34 AM:
-----------------------------------------------------------------------------
The following currently seems to happen:
* {{following\(x)}} internally creates a new {{Sentence}} annotation {{r}} with
the offsets {{(20,20)}} which is used as a starting point reference
* when {{SelectFS}} internally creates the index iterator, it uses {{r}} to
initialize the iterator position in {{SelectFS_impl.maybePosition(...)}}
* according to the annotation index comparator, the insertion point for
{{r(20,20)}} is **after** {{a2(20,30)}} because the index is sorted by begin
(ascending) and by **end (descending)**
However, the behaviour that I expect would be that the iterator be initialized
with the position of {{a2}} which is the first annotation following {{a1}}.
was (Author: rec):
The following currently seems to happen:
* {{following(x)}} internally creates a new {{Sentence}} annotation {{r}} with
the offsets {{(20,20)}} which is used as a starting point reference
* when {{SelectFS}} internally creates the index iterator, it uses {{r}} to
initialize the iterator position in {{SelectFS_impl.maybePosition(...)}}
* according to the annotation index comparator, the insertion point for
{{r(20,20)}} is **after** {{a2(20,30)}} because the index is sorted by begin
(ascending) and by **end (descending)**
However, the behaviour that I expect would be that the iterator be initialized
with the position of {{a2}} which is the first annotation following {{a1}}.
> select.following() fails to find adjacent annotations
> -----------------------------------------------------
>
> Key: UIMA-6284
> URL: https://issues.apache.org/jira/browse/UIMA-6284
> Project: UIMA
> Issue Type: New Feature
> Components: Core Java Framework
> Affects Versions: 3.1.1SDK
> Reporter: Richard Eckart de Castilho
> Assignee: Richard Eckart de Castilho
> Priority: Major
> Fix For: 3.2.0SDK
>
>
> Select following\(x) fails to return an annotation which starts at the end
> position of x - or otherwise said, the test below fails.
> {code}
> @Test
> public void thatSelectFollowingReturnsAdjacentAnnotation()
> {
> Annotation a1 = cas.createAnnotation(cas.getCasType(Sentence.class), 10,
> 20);
> Annotation a2 = cas.createAnnotation(cas.getCasType(Sentence.class), 20,
> 30);
>
> asList(a1, a2).forEach(cas::addFsToIndexes);
>
> List<Annotation> selection =
> cas.<Annotation>select(cas.getCasType(Sentence.class))
> .following(a1)
> .asList();
>
> assertThat(selection)
> .containsExactly(a2);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)