[
https://issues.apache.org/jira/browse/UIMA-6285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Eckart de Castilho updated UIMA-6285:
---------------------------------------------
Issue Type: Bug (was: New Feature)
> select.following() on a zero-width annotation returns other zero-width
> annotation at same location
> --------------------------------------------------------------------------------------------------
>
> Key: UIMA-6285
> URL: https://issues.apache.org/jira/browse/UIMA-6285
> Project: UIMA
> Issue Type: Bug
> Affects Versions: 3.1.1SDK
> Reporter: Richard Eckart de Castilho
> Assignee: Richard Eckart de Castilho
> Priority: Major
> Fix For: 3.2.0SDK
>
>
> select.following() on a zero-width annotation returns other zero-width
> annotation at same location. The following test fails:
> {code}
> @Test
> public void
> thatSelectFollowingDoesNotFindOtherZeroWidthAnnotationAtSameLocation()
> {
> Annotation a1 = cas.createAnnotation(cas.getAnnotationType(), 10, 10);
> Annotation a2 = cas.createAnnotation(cas.getAnnotationType(), 10, 10);
>
> asList(a1, a2).forEach(cas::addFsToIndexes);
>
> List<Annotation> selection = cas.select(Annotation.class)
> .following(a1)
> .asList();
>
> assertThat(selection)
> .isEmpty();
> }
> {code}
> In this case, {{a2}} should not be considered as "following" {{a1}} - it is
> not following, it is at the very same location.
> Strictly speaking, the code does what the documentation of following says:
> {quote}
> For AnnotationIndex, position to first Annotation whose {{begin <=
> fs.getEnd()}};
> {quote}
> In this case, {{a2.getBegin() == fs.getEnd()}}. However, I believe it is an
> edge-case that was not considered when the documentation was written and the
> intended behavior should be that annotations that are at exactly the same
> position should never be considered to be following or preceding each other.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)