Package org.apache.uima.cas

Examples of org.apache.uima.cas.CAS.createAnnotation()


        }
        for (String uncheckedTypeName : typesToTransferUnchecked) {
          Type type = cas.getTypeSystem().getType(uncheckedTypeName);
          if (type != null) {
            for (AnnotationFS annot : casSource.getAnnotationIndex(type)) {
              cas.addFsToIndexes(cas.createAnnotation(type, annot.getBegin(), annot.getEnd()));
            }
          }
        }
        AnnotationCheckTreeNode[] annotationNodes = each.getChildren();
        for (AnnotationCheckTreeNode eachAN : annotationNodes) {
View Full Code Here


          if (valueTest instanceof AnnotationFS) {
            AnnotationFS a1 = (AnnotationFS) valueTest;
            Feature feature2 = newFS.getType().getFeatureByBaseName(feature.getShortName());
            if (feature2 != null) {
              Type range2 = runTS.getType(range.getName());
              AnnotationFS createAnnotation = runCas.createAnnotation(range2, a1.getBegin(),
                      a1.getEnd());
              newFS.setFeatureValue(feature2, createAnnotation);
            }
          }
        }
View Full Code Here

        List<Type> types = groupTypes.get(i);
        if (types != null) {
          createAnnotations(i, delta, begin, end, types, fa, matchResult, ruleMatch, stream);
        } else if (i == 0) {
          CAS cas = stream.getCas();
          AnnotationFS afs = cas.createAnnotation(cas.getAnnotationType(), delta + begin, delta
                  + end);
          ruleMatch.addMatched(0, afs);
        }
      }
      List<AnnotationFS> matchedAnnotationsOfRoot = ruleMatch.getMatchedAnnotationsOfRoot();
View Full Code Here

          Map<Integer, Map<Type, Map<String, Object>>> fa, MatchResult matchResult,
          RegExpRuleMatch match, RutaStream stream) {
    CAS cas = stream.getCas();
    if (begin < end) {
      for (Type type : globalTypes) {
        AnnotationFS afs = cas.createAnnotation(type, delta + begin, delta + end);
        fillFeatures(group, afs, fa, delta, matchResult, stream);
        match.addMatched(group, afs);
        stream.addAnnotation(afs, true, true, match);
      }
    }
View Full Code Here

                  // afs.setFeatureValue(feature, UIMAUtils.toFSArray(jcas, annotations));
                } else {
                  int begin = delta + matchResult.start(cg);
                  int end = delta + matchResult.end(cg);
                  if (begin < end) {
                    AnnotationFS a = cas.createAnnotation(range, begin, end);
                    afs.setFeatureValue(feature, a);
                  }
                }
              }
            } else {
View Full Code Here

          if (valueTest instanceof AnnotationFS) {
            AnnotationFS a1 = (AnnotationFS) valueTest;
            Feature feature2 = newFS.getType().getFeatureByBaseName(feature.getShortName());
            if (feature2 != null) {
              Type range2 = runTS.getType(range.getName());
              AnnotationFS createAnnotation = runCas.createAnnotation(range2, a1.getBegin(),
                      a1.getEnd());
              newFS.setFeatureValue(feature2, createAnnotation);
            }
          }
        }
View Full Code Here

          if (valueTest instanceof AnnotationFS) {
            AnnotationFS a1 = (AnnotationFS) valueTest;
            Feature feature2 = newFS.getType().getFeatureByBaseName(feature.getShortName());
            if (feature2 != null) {
              Type range2 = runTS.getType(range.getName());
              AnnotationFS createAnnotation = runCas.createAnnotation(range2, a1.getBegin(),
                      a1.getEnd());
              newFS.setFeatureValue(feature2, createAnnotation);
            }
          }
        }
View Full Code Here

    List<WhiskRuleItem> result = new ArrayList<WhiskRuleItem>();
    int end = whiskRuleItem.getWordConstraint().getTokenAnnotation().getEnd();
    CAS cas = example.getDocumentCAS();
    // TODO: access type with string constant
    Type frameType = cas.getTypeSystem().getType("org.apache.uima.ruta.type.RutaFrame");
    AnnotationFS pointer = cas.createAnnotation(frameType, end, Integer.MAX_VALUE);
    FSIterator iterator = cas.getAnnotationIndex().iterator(pointer);
    int nextBegin = -1;
    while (iterator.isValid()) {
      FeatureStructure fs = iterator.get();
      if (fs instanceof AnnotationFS) {
View Full Code Here

    int begin = whiskRuleItem.getWordConstraint().getTokenAnnotation().getBegin();
    CAS cas = example.getDocumentCAS();

    // TODO: access type with string constant
    Type frameType = cas.getTypeSystem().getType("org.apache.uima.ruta.type.RutaFrame");
    AnnotationFS pointer = cas.createAnnotation(frameType, begin, begin);
    FSIterator iterator = cas.getAnnotationIndex().iterator(pointer);
    int nextEnd = -1;

    // ???
    iterator.moveToPrevious();
View Full Code Here

          TextRulerExample example) {
    List<List<WhiskRuleItem>> result = new ArrayList<List<WhiskRuleItem>>();
    CAS cas = example.getDocumentCAS();
    // TODO: access type with string constant
    Type frameType = cas.getTypeSystem().getType("org.apache.uima.ruta.type.RutaFrame");
    AnnotationFS pointer = cas.createAnnotation(frameType, startPos, endPos);
    FSIterator iterator = cas.getAnnotationIndex().iterator(pointer);
    List<AnnotationFS> startAs = new ArrayList<AnnotationFS>();
    int firstBegin = -1;
    while (iterator.isValid()) {
      FeatureStructure fs = iterator.get();
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.