Package org.apache.uima.cas

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


    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
    CAS cas = ae.newCAS();

    ae.setConfigParameterValue(HtmlConverter.OUTPUT_VIEW, outputViewName);
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(htmlWithComments);

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


    CAS cas = ae.newCAS();

    ae.setConfigParameterValue(HtmlConverter.OUTPUT_VIEW, outputViewName);
    ae.setConfigParameterValue(HtmlConverter.NEWLINE_INDUCING_TAGS, new String[] { "br" });
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(htmlWin);

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

    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
    CAS cas = ae.newCAS();

    ae.setConfigParameterValue(HtmlConverter.OUTPUT_VIEW, outputViewName);
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(htmlWithCommentsAndScript);

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

      ae.setConfigParameterValue("outputView", outputViewName);
      ae.reconfigure();

      // 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);
View Full Code Here

    ae.setConfigParameterValue("outputView", outputViewName);
    ae.reconfigure();

    // 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);
View Full Code Here

    String inputViewName = "inview";

    ae.setConfigParameterValue(HtmlConverter.INPUT_VIEW, inputViewName);
    ae.setConfigParameterValue(HtmlConverter.OUTPUT_VIEW, outputViewName);
    ae.reconfigure();
    cas.reset();
    CAS inview = cas.createView(inputViewName);
    inview.setDocumentText(htmlUnix);

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

    t1 = cas.getTypeSystem().getType(TEST_TYPE);
    assertEquals(1, cas.getAnnotationIndex(t1).size());

    // reset the cas and do it again
    cas.reset();
    cas.setDocumentText(input);
    SimplePipeline.runPipeline(cas, ae);

    t1 = cas.getTypeSystem().getType(TEST_TYPE);
    assertEquals(1, cas.getAnnotationIndex(t1).size());
View Full Code Here

    AnnotationIndex<AnnotationFS> ai = null;
    FSIterator<AnnotationFS> iterator = null;

    ae.setConfigParameterValue("onlyContent", false);
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(html);
    ae.process(cas);
    ai = cas.getAnnotationIndex(tagType);
    iterator = ai.iterator();
    assertEquals(7, ai.size());
View Full Code Here

    assertEquals(96, a.getEnd());

   
    ae.setConfigParameterValue("onlyContent", true);
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(html);
    ae.process(cas);
    ai = cas.getAnnotationIndex(tagType);
    iterator = ai.iterator();
    assertEquals(4, ai.size());
View Full Code Here

              cas.release();
            }
            return Status.CANCEL_STATUS;
          }

          cas.reset();
          if (each.getName().endsWith("xmi")) {
            XmiCasDeserializer.deserialize(new FileInputStream(each), cas, true);
          } else {
            cas.setDocumentText(getText(each));
          }
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.