Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.AnalysisEngine.process()


        ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
                .createResultSpecification();
        resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
        ae.process(cas, resultSpec);
      } else {
        ae.process(cas);
      }
      // check fileoutput
      boolean compare = FileCompare.compare(outputReferenceFile, JUnitExtension.getFile(refFile));
      Assert.assertTrue(compare);
      if (compare) {
View Full Code Here


        String document = FileUtils.file2String(inputFile);
       
        CAS.setDocumentText(getText(document).trim());

        // analyze
        ae.process(CAS);

        // set GUI look and feel
        try {
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
View Full Code Here

    CAS cas = ae.newCAS();
    Assert.assertTrue(cas != null);
   
    //process CAS
    cas.setDocumentText("Sample text for testing");
    ae.process(cas);
   
    // clean-up the results
    pmController.cleanUp();
  }
}
View Full Code Here

         // Set the document text on the CAS.
         cas
               .setDocumentText("This is a simple text to check if the configuration works");
         cas.setDocumentLanguage("en");
         // Process the sample document.
         ae.process(cas);

         return ae;
      } catch (Exception ex) {
         JUnitExtension.handleException(ex);
      }
View Full Code Here

         CAS cas = ae.newCAS();
         // Set the document text on the CAS.
         cas.setDocumentText(text);
         cas.setDocumentLanguage(language);
         // Process the sample document.
         ae.process(cas);

         return cas;
      } catch (Exception ex) {
         JUnitExtension.handleException(ex);
      }
View Full Code Here

    File descFile = JUnitExtension.getFile("TextAnalysisEngineImplTest/TestPrimitiveTae1.xml");
    AnalysisEngineDescription desc = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(
            new XMLInputSource(descFile));
    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(desc);
    CAS cas = ae.newCAS();
    ae.process(cas);
    assertNull(((CASImpl)cas).getCurrentComponentInfo());
   
    //same test for aggregate
    //test the CAS.getCurrentComponentInfo() is null after a component has
    //been processed
View Full Code Here

    descFile = JUnitExtension.getFile("TextAnalysisEngineImplTest/AggregateTaeForMergeTest.xml");
    desc = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(
            new XMLInputSource(descFile));
    ae = UIMAFramework.produceAnalysisEngine(desc);
    cas = ae.newCAS();
    ae.process(cas);
    assertNull(((CASImpl)cas).getCurrentComponentInfo());
  }
}
View Full Code Here

      // process(CAS)
      CAS tcas = tae.newCAS();
      mLastTypeSystem = tcas.getTypeSystem();
      tcas.setDocumentText("new test");
      tae.process(tcas);
      tcas.reset();

      // process(CAS,ResultSpecification)
      ResultSpecification resultSpec = new ResultSpecification_impl(tcas.getTypeSystem());
      resultSpec.addResultType("NamedEntity", true);
View Full Code Here

      // process(CAS,ResultSpecification)
      ResultSpecification resultSpec = new ResultSpecification_impl(tcas.getTypeSystem());
      resultSpec.addResultType("NamedEntity", true);

      tcas.setDocumentText("testing...");
      tae.process(tcas, resultSpec);
      tcas.reset();
    } finally {
      aPool.releaseAnalysisEngine(tae);
    }
  }
View Full Code Here

        warmupTimer.start();

        // process dummy document
        cas.setDocumentLanguage("en");
        cas.setDocumentText("This is a test sentence.");
        ae.process(cas);
        cas.reset();

        // stop warmup timer
        warmupTimer.stop();
        result.setWarmupTime(warmupTimer.getTimeSpan());
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.