google-code-export / uimafit

Automatically exported from code.google.com/p/uimafit
2 stars 1 forks source link

JCasUtil.selectFollowing doesn't start after the given annotation #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following test fails:

        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();

        List<Token> following = selectFollowing(this.jCas, Token.class, sentence, 1);
        assertEquals(Arrays.asList("D"), JCasUtil.toText(following));

Instead of "D", selectFollowing is returning "C" because it's only advancing to 
the beginning of the Sentence annotation, not advancing past the end of it.

Original issue reported on code.google.com by steven.b...@gmail.com on 14 Apr 2011 at 11:04

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r594.

Original comment by steven.b...@gmail.com on 14 Apr 2011 at 11:06

GoogleCodeExporter commented 9 years ago

Original comment by richard.eckart on 8 May 2011 at 10:41