Richard Eckart de Castilho created UIMA-5844:
------------------------------------------------

             Summary: SelectFS.following doesn't work
                 Key: UIMA-5844
                 URL: https://issues.apache.org/jira/browse/UIMA-5844
             Project: UIMA
          Issue Type: Bug
          Components: Core Java Framework
    Affects Versions: 3.0.0SDK
            Reporter: Richard Eckart de Castilho
             Fix For: 3.0.1SDK


It seems as if the SelectFS following method doesn't work at all:

{code}
  @Test
  public void testSelectFollowingPrecedingDifferentTypes() {
    this.jCas.setDocumentText("A B C D E");
    Token a = new Token(this.jCas, 0, 1);
    Token b = new Token(this.jCas, 2, 3);
    Token c = new Token(this.jCas, 4, 5);
    Token d = new Token(this.jCas, 6, 7);
    Token e = new Token(this.jCas, 8, 9);
    for (Token token : Arrays.asList(a, b, c, d, e)) {
      token.addToIndexes();
    }
    Sentence sentence = new Sentence(this.jCas, 2, 5);
    sentence.addToIndexes();

    // uimaFIT: selectFollowing(this.jCas, Token.class, sentence, 1);
    List<Token> following1 = 
jCas.select(Token.class).following(sentence).limit(1).asList();
    assertEquals(Arrays.asList("D"), JCasUtil.toText(following1));
    assertEquals(Arrays.asList(d), following1);
{code}

This fails with 

{code}
java.lang.AssertionError: expected:<[D]> but was:<[A]>
{code}

It seems as if the `following` simply has no effect. If the `limit is removed`, 
the whole set of Tokens is returned.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to