[ 
https://issues.apache.org/jira/browse/UIMA-6285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17218922#comment-17218922
 ] 

Richard Eckart de Castilho commented on UIMA-6285:
--------------------------------------------------

The current code works if the annotations are not zero-width. The following 
test does not fail:

{code}
  @Test
  public void thatSelectFollowingDoesNotFindOtherAnnotationAtSameLocation()
  {
    Annotation a1 = cas.createAnnotation(cas.getAnnotationType(), 10, 20);
    Annotation a2 = cas.createAnnotation(cas.getAnnotationType(), 10, 20);
    
    asList(a1, a2).forEach(cas::addFsToIndexes);
    
    List<Annotation> selection = cas.select(Annotation.class)
        .following(a1)
        .asList();
    
    assertThat(selection)
            .isEmpty();
  }
{code}

> 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: New Feature
>    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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to