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

uv3 remove positionUsesType from select api

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0SDK-alpha02
    • 3.0.0SDK-beta
    • None
    • None

    Description

      The select API attempts to combine some of uimaFIT's capability for iterating. The design included a configuration choice "positionUsesType". This was implemented incorrectly for some cases, and it seems it would be hard to fix. This Jira suggests removing it altogether.

      What it does: It affects two bits of iterator operation:

      1. moveTo(fs) - move to the leftmost item that "matches" fs
      2. for bounded iterators: skip the item which is "equal" to the bound.

      Details: The "matches" in 1) is based on the comparator for the index. For Annotation indexes, this includes the typePriority. However, the select API framework by default doesn't use type priorities (can be configured though). This means, if the underlying iterator is using type priorities, then doing a moveTo on it will move to a spot which might not be the "left-most" when type priorities are not used. The correction for this has two flavors: depending on the setting of positionUsesType. If not specified, the correction worked, and moved to the left-most same-begin-end-ignoring-type. If specified, the correction was ignoring this, and a fix would need to scan in both directions to find the right type. Although this could be done, it's complex. And I think this is designing beyond a real need.

      Use 2 is for skipping the bounding annotation when iterating (if it is in the index). The normal mode for skipping is to skip only the item if it is == identical to the bounding annotation. But (for UIMA v2 bounded iterator compatibility) a mode where the compare is done using the Annotation Comparator is provided. The positionUsesType would narrow this equal test by also requiring that the types match. I think this is unnecessarily complex, since I think most uses will be using the == style.

      So I propose to remove positionUsesType from the implementation / documentation.

      Attachments

        Issue Links

          Activity

            People

              schor Marshall Schor
              schor Marshall Schor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: