Package org.apache.uima.cas

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


    Type typeSW = cas.getTypeSystem().getType("org.apache.uima.ruta.type.SW");
    cas.addFsToIndexes(cas.createAnnotation(typeCW, 0, 5));
    cas.addFsToIndexes(cas.createAnnotation(typeCW, 7, 13));
    cas.addFsToIndexes(cas.createAnnotation(typeCW, 15, 18));
    cas.addFsToIndexes(cas.createAnnotation(typeSW, 19, 22));
    cas.addFsToIndexes(cas.createAnnotation(typeCW, 23, 28));
   
    ae.process(cas);

    Type t = null;
    AnnotationIndex<AnnotationFS> ai = null;
View Full Code Here


      // create the cas and input annotation
      CAS cas = ae.newCAS();
      cas.reset();
      cas.setDocumentText(htmlContent);
      Type boldType = cas.getTypeSystem().getType(HtmlAnnotator.NAMESPACE + "B");
      AnnotationFS fs = cas.createAnnotation(boldType, 78, 89);
      cas.addFsToIndexes(fs);

      // go:
      ae.process(cas);
View Full Code Here

    // create the cas and input annotation
    CAS cas = ae.newCAS();
    cas.reset();
    cas.setDocumentText(htmlDecodingAnnotations);
    Type boldType = cas.getTypeSystem().getType(HtmlAnnotator.NAMESPACE + "B");
    AnnotationFS fs1 = cas.createAnnotation(boldType, 210, 221);
    AnnotationFS fs2 = cas.createAnnotation(boldType, 279, 290);
    cas.addFsToIndexes(fs1);
    cas.addFsToIndexes(fs2);

    // go:
View Full Code Here

    CAS cas = ae.newCAS();
    cas.reset();
    cas.setDocumentText(htmlDecodingAnnotations);
    Type boldType = cas.getTypeSystem().getType(HtmlAnnotator.NAMESPACE + "B");
    AnnotationFS fs1 = cas.createAnnotation(boldType, 210, 221);
    AnnotationFS fs2 = cas.createAnnotation(boldType, 279, 290);
    cas.addFsToIndexes(fs1);
    cas.addFsToIndexes(fs2);

    // go:
    ae.process(cas);
View Full Code Here

    ai = cas.getAnnotationIndex(t);
    assertEquals(0, ai.size());
   
    Type type1 = cas.getTypeSystem().getType("org.apache.uima.SubAtomic1");
    Type type2 = cas.getTypeSystem().getType("org.apache.uima.SubAtomic2");
    AnnotationFS a1 = cas.createAnnotation(type1, 7, 10);
    AnnotationFS a2 = cas.createAnnotation(type2, 10, 13);
    cas.addFsToIndexes(a1);
    cas.addFsToIndexes(a2);
   
    try {
View Full Code Here

    assertEquals(0, ai.size());
   
    Type type1 = cas.getTypeSystem().getType("org.apache.uima.SubAtomic1");
    Type type2 = cas.getTypeSystem().getType("org.apache.uima.SubAtomic2");
    AnnotationFS a1 = cas.createAnnotation(type1, 7, 10);
    AnnotationFS a2 = cas.createAnnotation(type2, 10, 13);
    cas.addFsToIndexes(a1);
    cas.addFsToIndexes(a2);
   
    try {
      cas = RutaTestUtils.process(namespace + "/" + name + RutaEngine.SCRIPT_FILE_EXTENSION, namespace + "/" + name
View Full Code Here

            }
          }
        }
      }
      if (cas != null && end != 0) {
        AnnotationFS annotation = cas.createAnnotation(cas.getAnnotationType(), begin, end);
        result.add(annotation);
      }
    }
    return result;
  }
View Full Code Here

      begin = filteredBegin;
      end = filteredEnd;
    } else {
      type = cas.getTypeSystem().getType(RutaEngine.OPTIONAL_TYPE);
    }
    AnnotationFS afs = cas.createAnnotation(type, begin, end);
    return afs;
  }

  private void doMatch(AnnotationFS annotation, RuleMatch ruleMatch,
          ComposedRuleElementMatch containerMatch, boolean ruleAnchor, RutaStream stream,
View Full Code Here

          endNew = valueEnd + deltaAfter;
        }

        String typeName = each.getType().getName();
        Type type = newCAS.getTypeSystem().getType(typeName);
        FeatureStructure newAnnotation = newCAS.createAnnotation(type, beginNew, endNew);
        newCAS.addFsToIndexes(newAnnotation);
      }

      targetEngine.process(newCAS);
View Full Code Here

        if (lastWasEmpty && !wsLine) {
          paragraphBegin = offsetTillNow;
        }

        if (wsLine && !emptyLine) {
          AnnotationFS newWSLineFS = cas.createAnnotation(wsLineType, offsetTillNow, offsetTillNow
                  + eachLine.length());
          cas.addFsToIndexes(newWSLineFS);
        } else if (!emptyLine) {
          AnnotationFS newLineFS = cas.createAnnotation(lineType, offsetTillNow, offsetTillNow
                  + eachLine.length());
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.