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

moveTo() and iterator(fs) do not point to "leftmost" FS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.4.0SDK
    • Core Java Framework
    • None

    Description

      According to the API docs FSIterator.moveTo(FeatureStructure fs) should move the iterator to "the first features structure that is equal to fs". In case we have multiple annotations of same type and same region (same start/end) as fs moveTo() will point to one of them but not necessarily to the first (leftmost) one (in iterator order).
      The inconsistency to the API doc is even more clear with FSIndex.iterator(FeatureStructure fs). The API doc states: "The position of the iterator will be set such that the feature structure returned by a call to the iterator's get() method is greater than or equal to fs, and any previous FS is less than FS." Thus if we have multiple annotations of same type as fs and same region one would expect the iterator to start with the left most one and return all of these annotations using next(). However as with moveTo() this is not the case. E.g. after iterator creation calling moveToPrevious() followed by get() returns sometimes one of the annotations with same region as fs (and same type).

      Attachments

        Issue Links

          Activity

            People

              twgoetz Thilo Goetz
              tboehme Timo Boehme
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: