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

Ruta: No type check of features in TRANSFER

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.1ruta, 3.1.0ruta
    • 3.2.0ruta
    • Ruta
    • None

    Description

      Hi again.

      I think there is a bug in action TRANSFER when it comes to transferring - or better not transferring - values from a feature of kind A to a feature of type B, where both features have the same identifier. Such an attempt throws an exception in cases where values cannot implicitly be converted. An example:

      Text:

      alpha beta

      Script:

      DECLARE T1 (Annotation a, STRING ID);
      DECLARE T2 (STRING a, INT ID);
      w:"alpha" {-> CREATE(T1, "a" = w, "ID" = "3ef9")};
      T1 {-> TRANSFER(T2)};

      Expected output (new annotations):

      • {type: T2, begin: 0, end:5, features:{}}

      But throws:

      org.apache.uima.cas.CASRuntimeException: Trying to access value of feature "Main.T2:a" as "uima.cas.String", but range of feature is "org.apache.uima.ruta.type.RutaBasic".

      My suggestion is to only transfer values between features if they are of the same kind, for consistency's sake.

      Best, Michael

      Attachments

        Issue Links

          Activity

            People

              pkluegl Peter Klügl
              Michael Stenger Michael Stenger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: