Package org.apache.uima.cas

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


      }
      try {
        if (cas == null) {
          cas = ae.newCAS();
        } else {
          cas.reset();
        }
        if (each.getName().endsWith("xmi")) {
          XmiCasDeserializer.deserialize(new FileInputStream(each), cas, true);
        } else {
          cas.setDocumentText(getText(each));
View Full Code Here


  public void testRuleOnDocument(final TextRulerRule rule, final TextRulerExampleDocument doc,
          final TextRulerStatisticsCollector c) {
    CAS testCAS = getTestCAS();
    doc.resetAndFillTestCAS(testCAS, rule.getTarget());
    testRuleOnDocument(rule, doc, c, testCAS);
    testCAS.reset();
    // GlobalCASSource.releaseCAS(testCAS);
  }

  public void testRuleOnDocument(final TextRulerRule rule, final TextRulerExampleDocument doc,
          final TextRulerStatisticsCollector c, CAS testCas) {
View Full Code Here

            return;
        }
        inducedRules.put(ruleString, sumC);
      }
    }
    theTestCAS.reset();
    // GlobalCASSource.releaseCAS(theTestCAS);
    // do not release the shared test-cas ! only reset it ! it gets released
    // at the end of the
    // whole algorithm !
    for (int ruleIndex = 0; ruleIndex < rules.size(); ruleIndex++)
View Full Code Here

      document.resetAndFillTestCAS(theTestCAS, target);
      testRuleOnDocument(theRule, document, sumC, theTestCAS);
      if (shouldAbort())
        return;
    }
    theTestCAS.reset();
    // GlobalCASSource.releaseCAS(theTestCAS);
    // do not release the shared test-cas ! only reset it ! it gets released
    // at the end of the
    // whole algorithm !
    for (int ruleIndex = 0; ruleIndex < rules.size(); ruleIndex++)
View Full Code Here

        TextRulerToolkit.writeCAStoXMIFile(cas, outputFolder + "/processed_" + file.getName());
      } catch (Exception e) {
        TextRulerPlugin.error(e);
        TextRulerToolkit.log(" ERROR!");
      }
      cas.reset();
      if (delegate != null)
        delegate.preprocessorStatusUpdate(this, "Done");
    }
    if (cas != null) {
      cas.reset();
View Full Code Here

      cas.reset();
      if (delegate != null)
        delegate.preprocessorStatusUpdate(this, "Done");
    }
    if (cas != null) {
      cas.reset();
      GlobalCASSource.releaseCAS(cas);
    }
    return tmpDir + docType;
  }
View Full Code Here

    ae.setConfigParameterValue(HtmlConverter.OUTPUT_VIEW, outputViewName);
    ae.setConfigParameterValue(HtmlConverter.CONVERSION_POLICY, "explicit");
    ae.setConfigParameterValue(HtmlConverter.CONVERSION_PATTERNS, new String[] { "&nbsp;" });
    ae.setConfigParameterValue(HtmlConverter.CONVERSION_REPLACEMENTS, new String[] { " " });
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(htmlDecoding);

    // 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(htmlDecoding);

    // 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(htmlUnix);

    // 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(htmlWin);

    // go:
    ae.process(cas);
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.