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
Original issue reported on code.google.com by
steven.b...@gmail.com
on 14 Apr 2011 at 11:04