Package org.apache.uima.cas

Examples of org.apache.uima.cas.TypeSystem.subsumes()


             
              Type range = value.getFeature().getRange();

              FeatureStructure dragFeatureStructure = (FeatureStructure) event.data;
             
              if (typeSystem.subsumes(range, dragFeatureStructure.getType())) {

                FeatureStructure target = value.getFeatureStructure();

                target.setFeatureValue(value.getFeature(), dragFeatureStructure);
View Full Code Here


  private boolean isEmptyList(LowLevelCAS cas, int type) {
    Type candidateType = cas.ll_getTypeSystem().ll_getTypeForCode(type);
    TypeSystem typeSystem = ((CASImpl) cas).getTypeSystem();
    boolean isEmpty = false;
    for (int i = 0; i < this.emptyListTypes.length && (!isEmpty); i++) {
      isEmpty = typeSystem.subsumes(this.emptyListTypes[i], candidateType);
    }
    return isEmpty;
  }

  // only returns a sensible value if isArray returns true
View Full Code Here

    Type annotationType = cas.getTypeSystem().getType(CAS.TYPE_NAME_ANNOTATION);
    for (TypeMap tspec : rspec.getTypeSpecs()) {
      TypeSystem typeSystem = cas.getTypeSystem();
      Type type = typeSystem.getType(tspec.getTypeName());
      // Check that type exists and is an annotation.
      if ((type == null) || !typeSystem.subsumes(annotationType, type)) {
        // If not, skip.
        continue;
      }
      // Iterate over FSs, filter and create output.
      FSIterator iterator = cas.getAnnotationIndex(type).iterator();
View Full Code Here

      return ((ArrayFS) fs).toArray();
    }
    CASImpl cas = (CASImpl) fs.getCAS();
    TypeSystem ts = cas.getTypeSystem();
    Type fsType = fs.getType();
    if (ts.subsumes(ts.getType("uima.cas.FloatList"), fsType)) {
      return (floatListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.IntegerList"), fsType)) {
      return (integerListToArray(fs));
    }
View Full Code Here

    TypeSystem ts = cas.getTypeSystem();
    Type fsType = fs.getType();
    if (ts.subsumes(ts.getType("uima.cas.FloatList"), fsType)) {
      return (floatListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.IntegerList"), fsType)) {
      return (integerListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.StringList"), fsType)) {
      return (stringListToArray(fs));
    }
View Full Code Here

      return (floatListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.IntegerList"), fsType)) {
      return (integerListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.StringList"), fsType)) {
      return (stringListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.FSList"), fsType)) {
      return (fsListToArray(fs));
    }
View Full Code Here

      return (integerListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.StringList"), fsType)) {
      return (stringListToArray(fs));
    }
    if (ts.subsumes(ts.getType("uima.cas.FSList"), fsType)) {
      return (fsListToArray(fs));
    }

    DebugNameValuePair[] result;
    String typeName = fsType.getName();
View Full Code Here

    boolean isJCasClass = false;
    if (fs.getClass().getName().equals(typeName)) { // true for JCas cover classes
      isJCasClass = true;
    }

    if (ts.subsumes(cas.getAnnotationType(), fsType)) {
      isAnnotation = true;
    }

    result = new DebugNameValuePair[(isJCasClass ? 0 : 1) // slot for type name if not JCas
            + (isAnnotation ? 3 : nbrFeats) // annotations have 4 slot display
View Full Code Here

    List list = new ArrayList();
    TypeSystem ts = this.cas.getTypeSystem();
    // Iterate over fsvars and add names to list.
    for (FSIterator it = this.index.iterator(); it.isValid(); it.moveToNext()) {
      String typeName = it.get().getStringValue(this.typeFeature);
      if (ts.subsumes(type, ts.getType(typeName))) {
        list.add(it.get().getStringValue(this.nameFeature));
      }
    }
    return list;
  }
View Full Code Here

      scopeContextAnnotations.add(focus);
    else if (scopeContextAnnotations.size() == 0) {
      TypeSystem typeSystem = jCas.getTypeSystem();
      Type superType = jCas.getType(focusType).casType;
      Type subType = focus.getType();
      if (typeSystem.subsumes(superType, subType))
        scopeContextAnnotations.add(focus);
    }
    return scopeContextAnnotations;
  }
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.