Examples of ArrayFS


Examples of org.apache.uima.cas.ArrayFS

    cas.addFsToIndexes(fs);
   
    createIntA(fs,0);
   
    // feature structure array
    ArrayFS fsafs = cas.createArrayFS(4);
    fsafs.set(1, fs8);
    fsafs.set(2, fs1);
    fsafs.set(3, fs4);
    fs.setFeatureValue(akofAfs, fsafs);
   
    createFloatA(fs, 0f);
    createDoubleA(fs, 0d);
    createLongA(fs, 0L);
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

            sfs.set(0, (byte)1);
          }
        }
        break;
      case 25: {
          ArrayFS sfs = (ArrayFS) fs.getFeatureValue(akofAfs);
          if ((null != sfs) && (0 < sfs.size())) {
            sfs.set(0, lfs.get(r.nextInt(lfs.size())));
          }
        }
      break;
      }
    }     
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

    MarkerImpl marker = (MarkerImpl) remoteCas.createMarker();
   
    lfs = getIndexedFSs(remoteCas, m);
    FeatureStructure fs = remoteCas.createFS(m.getType(Akof1));
    maybeSetFeature(fs, m, lfs.get(0));
    ArrayFS fsafs = remoteCas.createArrayFS(4);
    fsafs.set(1, lfs.get(1));
    fsafs.set(2, lfs.get(2));
    fsafs.set(3, lfs.get(3));
    maybeSetFeatureKind(fs, m, "Afs", fsafs);
   
    verifyDelta(marker, ri);
  }
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

   
    createIntA(cas, m, fs, 0);
   
    // feature structure array
    /* lfs index: 12 */
    ArrayFS fsafs = cas.createArrayFS(4);
    fsafs.set(1, fs8);
    fsafs.set(2, fs1);
    fsafs.set(3, fs4);
    maybeSetFeatureKind(fs, m, "Afs",  fsafs);
   
    createFloatA(cas, m, fs, 0f);
    createDoubleA(cas, m, fs, 0d);
    createLongA(cas, m, fs, 0L);
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

            sfs.set(0, (byte)1);
          }
        }
        break;
      case 25: {
          ArrayFS sfs = (ArrayFS) maybeGetFeatureKind(fs, m, "Afs");
          if ((null != sfs) && (0 < sfs.size())) {
            sfs.set(0, lfs.get(random.nextInt(lfs.size())));
          }
        }
      break;
      }
    }
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

    FeatureStructure relCopy = copier.copyFs(relFS);
    // verify copy
    CasComparer.assertEquals(relFS, relCopy);

    // test null array element
    ArrayFS arrFS = srcCas.createArrayFS(3);
    arrFS.set(0, annot);
    arrFS.set(1, null);
    arrFS.set(2, relFS);
    FeatureStructure copyArrFS = copier.copyFs(arrFS);
    CasComparer.assertEquals(arrFS, copyArrFS);
   
    // test with using base cas
    destCas = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(), indexes);
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

      //Test equals method for same annotation obtained through different views
      assertEquals(engAnnot, crossAnnot);
     
      // Test that annotations accessed from a reference in the base CAS
      // work correctly
      ArrayFS anArray =this.cas.createArrayFS(3);
      anArray.set(0, engAnnot);
      anArray.set(1, frAnnot);
      anArray.set(2, gerAnnot);
      AnnotationFS tstAnnot = (AnnotationFS) anArray.get(0);
      assertTrue(("this").equals(tstAnnot.getCoveredText()));
      tstAnnot = (AnnotationFS) anArray.get(1);
      assertTrue(("cette").equals(tstAnnot.getCoveredText()));
      tstAnnot = (AnnotationFS) anArray.get(2);
      assertTrue(("das").equals(tstAnnot.getCoveredText()));
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

    }

    int size;

    if (value instanceof ArrayFS) {
      ArrayFS array = (ArrayFS) value;

      size = array.size();
    } else if (value instanceof CommonArrayFS) {
      CommonArrayFS array = (CommonArrayFS) value;

      size = array.size();
    } else if (value instanceof StringArrayFS) {
      StringArrayFS array = (StringArrayFS) value;

      size = array.size();
    } else {
      throw new CasEditorError("Unkown array type!");
    }

    return size;
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

        return getElements(arrayFS);
      }
    } else if (parentElement instanceof ArrayValue) {
      ArrayValue value = (ArrayValue) parentElement;

      ArrayFS array = (ArrayFS) value.getFeatureStructure();

      return getElements(array.get(value.slot()));
    }
    else {
      throw new CasEditorError("Unexpected element type!");
    }
  }
View Full Code Here

Examples of org.apache.uima.cas.ArrayFS

      ArrayValue value = (ArrayValue) element;

      if (value.getFeatureStructure() instanceof ArrayFS) {

        ArrayFS array = (ArrayFS) value.getFeatureStructure();

        return hasChildren(array.get(value.slot()));
      }
      else {
        // false for primitive arrays
        return false;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.