Package org.apache.uima.cas

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


    TypeSystem typeSystem = fromJcas.getTypeSystem();
    Type docType = typeSystem.getType(UIMAConstants.TYPE_DOCUMENT);
    CasCopier casCopier = new CasCopier(fromJcas.getCas(), modview.getCas());
    for (Annotation annotation : annotationIndex) {
      // TODO be careful here, because some people inherit from DocumentAnnotation
      if (typeSystem.subsumes(docType, annotation.getType())) {
        continue;
      }
      Annotation clone = (Annotation) casCopier.copyFs(annotation);
      // change the view/sofa of the new annotation...
      // see: http://osdir.com/ml/apache.uima.general/2007-09/msg00107.html
View Full Code Here


  private List<AnnotationFS> getAnnotations(AnnotationFS annotation, Type type,
          FeatureMatchExpression fme, RutaStream stream) {
    List<AnnotationFS> result = new ArrayList<AnnotationFS>();
    TypeSystem typeSystem = stream.getCas().getTypeSystem();
    if (typeSystem.subsumes(type, annotation.getType())) {
      result.add(annotation);
    } else {
      Collection<AnnotationFS> beginAnchors = stream.getBeginAnchor(annotation.getBegin())
              .getBeginAnchors(type);
      Collection<AnnotationFS> endAnchors = stream.getEndAnchor(annotation.getEnd()).getEndAnchors(type);
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

              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

    for (Type eachType : allTypes) {
      if (!excludedTypes.contains(eachType.getName())) {
        List<Feature> features = eachType.getFeatures();
        for (Feature f : features) {
          Type range = f.getRange();
          if (typeSystem.subsumes(annotationType, range) || typeSystem.subsumes(stringType, range)) {
            if (!eachType.getName().startsWith("org.apache.uima.ruta.type")
                    && !typeSystem.subsumes(basicType, eachType)) {
              types.add(eachType);
              break;
            }
View Full Code Here

    for (Type eachType : allTypes) {
      if (!excludedTypes.contains(eachType.getName())) {
        List<Feature> features = eachType.getFeatures();
        for (Feature f : features) {
          Type range = f.getRange();
          if (typeSystem.subsumes(annotationType, range) || typeSystem.subsumes(stringType, range)) {
            if (!eachType.getName().startsWith("org.apache.uima.ruta.type")
                    && !typeSystem.subsumes(basicType, eachType)) {
              types.add(eachType);
              break;
            }
View Full Code Here

        List<Feature> features = eachType.getFeatures();
        for (Feature f : features) {
          Type range = f.getRange();
          if (typeSystem.subsumes(annotationType, range) || typeSystem.subsumes(stringType, range)) {
            if (!eachType.getName().startsWith("org.apache.uima.ruta.type")
                    && !typeSystem.subsumes(basicType, eachType)) {
              types.add(eachType);
              break;
            }
          }
        }
View Full Code Here

        while (iterator.isValid()) { // hasNext()
          FeatureStructure fs = iterator.get();
          List<Feature> features = fs.getType().getFeatures();
          for (Feature feature : features) {
            Type range = feature.getRange();
            if (typeSystem.subsumes(annotationType, range)
                    || UIMAConstants.TYPE_STRING.equals(range.getName())) {
              result.add(fs);
              break;
            }
          }
View Full Code Here

    for (Feature eachFeature1 : features1) {

      Type range = eachFeature1.getRange();

      if (typeSystem.subsumes(annotationType, range)) {

        String name = eachFeature1.getShortName();

        Feature eachFeature2 = type2.getFeatureByBaseName(name);
View Full Code Here

    TypeSystem typeSystem = cas.getTypeSystem();
    AnnotationIndex<AnnotationFS> annotationIndex = cas.getAnnotationIndex();
    for (AnnotationFS each : annotationIndex) {
      Type type = each.getType();
      for (Type eachType : types) {
        if (includeSubtypes && typeSystem.subsumes(eachType, type)) {
          result.add(each);
          break;
        } else if (eachType.getName().equals(type.getName())) {
          result.add(each);
          break;
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.