Package org.apache.uima.cas

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


    List<FeatureStructure> data = new ArrayList<FeatureStructure>();
    FSList i = aList;
    while (i instanceof NonEmptyFSList) {
      NonEmptyFSList l = (NonEmptyFSList) i;
      TOP value = l.getHead();
      if (value != null && (type == null || ts.subsumes(type, value.getType()))) {
        data.add(l.getHead());
      }
      i = l.getTail();
    }
View Full Code Here


    List<AnnotationFS> list = new ArrayList<AnnotationFS>();
    FSIterator<AnnotationFS> iter = cas.getAnnotationIndex().iterator();
    while (iter.hasNext()) {
      AnnotationFS a = iter.next();
      if ((a.getBegin() <= begin) && (a.getEnd() >= end)
              && ((type == null) || (ts.subsumes(type, a.getType())))) {
        list.add(a);
      }
    }
    return list;
  }
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

  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

              fs = document.getCAS().createArrayFS(arraySize);
            } else {
              throw new CasEditorError("Unkown array type: " + type.getName() + "!");
           
      }
      else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_ANNOTATION), type)) {
     
      // get begin of selection from editor, if any 
      // TODO: Add an interface to retrieve the span from the editor 
     
      int begin = 0;
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

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.