Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5844

SelectFS.following doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0SDK
    • 3.0.1SDK
    • Core Java Framework
    • None

    Description

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

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

      This fails with

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

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

      Attachments

        Activity

          People

            schor Marshall Schor
            rec Richard Eckart de Castilho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: