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

Unable to fetch preceding annotations in order

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0SDK
    • Fix Version/s: 3.0.1SDK
    • Component/s: UIMA
    • Labels:
      None

      Description

      uimaFIT has a call `selectPreceding` which returns the n annotations before the specified annotations in normal order.

      This seems to be quite difficult to replicate using UIMAv3 SelectFS:

          Annotation a = new Annotation(this.jCas, 0, 1);
          Annotation b = new Annotation(this.jCas, 2, 3);
          Annotation c = new Annotation(this.jCas, 4, 5);
      
          for (Annotation ann : Arrays.asList(a, b, c)) {
            ann.addToIndexes();
          }
      
          // uimaFIT: Arrays.asList(a, b), selectPreceding(this.jCas, Annotation.class, c, 2));
          // Produces reverse order
          assertEquals(Arrays.asList(a, b), jCas.select(Annotation.*class*).preceding(c).limit(2).asList());
          // Produces: java.lang.IllegalArgumentException: Strict requires BoundsUse.coveredBy
          assertEquals(Arrays.asList(a, b), jCas.select(Annotation.class).at(c).shifted(-2).limit(2).asList());
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: