Examples of TOP


Examples of org.apache.uima.jcas.cas.TOP

      this.featureValue = featureValue;
    }

    public void setValueFrom(Map<String, ? extends TOP> idAnnotationMap) {
      if (this.featureValue != null) {
        TOP valueAnnotation = idAnnotationMap.get(this.featureValue.id);
        if (valueAnnotation == null) {
          LOGGER.warn(String.format(
              "unable to set feature; found no annotation for %s",
              this.featureValue.id));
        } else {
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

        Annotation a = (Annotation) newFS;
        a.setBegin(matchedAnnotation.getBegin());
        a.setEnd(matchedAnnotation.getEnd());
        stream.addAnnotation(a, match);
      }
      TOP newStructure = null;
      if (newFS instanceof TOP) {
        newStructure = (TOP) newFS;
        gatherFeatures(newStructure, features, matchedAnnotation, element, match, stream);
        newStructure.addToIndexes();
      }
    }

  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

        Annotation a = (Annotation) newFS;
        a.setBegin(matchedAnnotation.getBegin());
        a.setEnd(matchedAnnotation.getEnd());
        stream.addAnnotation(a, match);
      }
      TOP newStructure = null;
      if (newFS instanceof TOP) {
        newStructure = (TOP) newFS;
        fillFeatures(newStructure, features, matchedAnnotation, element, stream);
        newStructure.addToIndexes();
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

        Annotation a = (Annotation) newFS;
        a.setBegin(annotationFS.getBegin());
        a.setEnd(annotationFS.getEnd());
        stream.addAnnotation(a, match);
      }
      TOP newStructure = null;
      if (newFS instanceof TOP) {
        newStructure = (TOP) newFS;
        fillFeatures(newStructure, map, annotationFS, element, rowWhere, stream);
        newStructure.addToIndexes();
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

        Annotation a = (Annotation) newFS;
        a.setBegin(annotationFS.getBegin());
        a.setEnd(annotationFS.getEnd());
        stream.addAnnotation(a, match);
      }
      TOP newStructure = null;
      if (newFS instanceof TOP) {
        newStructure = (TOP) newFS;
        fillFeatures(newStructure, map, annotationFS, element, rowWhere, stream);
        newStructure.addToIndexes();
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

        Annotation a = (Annotation) newFS;
        a.setBegin(matchedAnnotation.getBegin());
        a.setEnd(matchedAnnotation.getEnd());
        stream.addAnnotation(a, match);
      }
      TOP newStructure = null;
      if (newFS instanceof TOP) {
        newStructure = (TOP) newFS;
        gatherFeatures(newStructure, features, matchedAnnotation, element, match, stream);
        newStructure.addToIndexes();
      }
    }

  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

        Annotation a = (Annotation) newFS;
        a.setBegin(matchedAnnotation.getBegin());
        a.setEnd(matchedAnnotation.getEnd());
        stream.addAnnotation(a, match);
      }
      TOP newStructure = null;
      if (newFS instanceof TOP) {
        newStructure = (TOP) newFS;
        fillFeatures(newStructure, features, matchedAnnotation, element, stream);
        newStructure.addToIndexes();
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

    Iterator srcObjItr = indexes.getAnnotationIndex(org.apache.ctakes.typesystem.type.textspan.Segment.type).iterator();
    org.apache.ctakes.typesystem.type.textspan.Segment segment = null;
   
    while (srcObjItr.hasNext())
    {
      TOP srcObj = (TOP) srcObjItr.next();

      Object[] constrArgVals = { jcas };
      try
      {
        // create new destination object
        TOP destObj = (TOP) iv_destContr.newInstance(constrArgVals);
       
        // Find the segments that are to be handled as complete sections
                boolean okayToSkip = false;
                boolean segmentMissing = iv_skipSegmentsSet.isEmpty();
        if (!segmentMissing){
          Iterator getSkipSegs = iv_skipSegmentsSet.iterator();
          segment = (org.apache.ctakes.typesystem.type.textspan.Segment) srcObj;
          while (getSkipSegs.hasNext()  && !okayToSkip){
            if (getSkipSegs.next().equals(segment.getId())){

              okayToSkip = true;
            }
          }
         
        }
        // copy data from source to destination
        Iterator getterItr = iv_getSetMap.keySet().iterator();
       

        while (getterItr.hasNext() && (okayToSkip || segmentMissing))
        {
          Method getterMeth = (Method) getterItr.next();
          Method setterMeth = (Method) iv_getSetMap.get(getterMeth);

          Object val = getterMeth.invoke(srcObj, (Object []) null);
          Object[] setterArgs = { val };
          setterMeth.invoke(destObj, setterArgs);
         
        }
        // add new destination object to JCas
        if (okayToSkip) {
          destObj.addToIndexes();
        } else {
          Iterator lookupWindows = FSUtil.getAnnotationsInSpanIterator(jcas, org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation.type, segment.getBegin(), segment.getEnd());
          while (lookupWindows.hasNext()){
            org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation lookup = (org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation) lookupWindows.next();
            org.apache.ctakes.typesystem.type.textspan.DrugLookupWindowAnnotation drugLookup = new org.apache.ctakes.typesystem.type.textspan.DrugLookupWindowAnnotation (jcas, lookup.getBegin(), lookup.getEnd());
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

      } catch (CASException e1) {
       logAndThrow(e1, jcasView);
      }
    
     // Return eq fs instance if already created
      TOP fs = jcasView.getJfsFromCaddr(addr);
      if (null != fs) {
        fs.jcasType = jcasView.getType(type);
      } else {
        initargs[0] = new Integer(addr);
        initargs[1] = jcasView.getType(type);
View Full Code Here

Examples of org.apache.uima.jcas.cas.TOP

    TypeSystem ts = aList.getCAS().getTypeSystem();
    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
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.