/** * Resets the AE (AnalysisEngine), releasing all resources held by the * current AE. * * @param ae UIMA Analysis Engine */ public static void resetAE(AnalysisEngine ae) { if (ae != null) { ae.destroy(); ae = null; } } }
/** * Destroy ae. */ public void destroyAe() { this.cas = null; if (this.ae != null) { this.ae.destroy(); this.ae = null; } }
public void close() { if (cas != null) cas.release(); if (tae != null) tae.destroy(); }
@Override public void destroy() { super.destroy(); if (script != null) { Collection<AnalysisEngine> values = script.getAllEngines().values(); for (AnalysisEngine each : values) { each.destroy(); } } }
public void close() throws IOException { if (cas != null) cas.release(); if (tae != null) tae.destroy(); if (installDir != null) { FileUtils.deleteRecursive(installDir); } }
/** * @see org.apache.uima.resource.Resource#destroy() */ @Override public void destroy() { UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(), "destroy", LOG_RESOURCE_BUNDLE, "UIMA_analysis_engine_destroyed__CONFIG", new Object[] { this.ae.getAnalysisEngineMetaData().getName() }); this.ae.destroy(); }
@After public void tearDown() { if (ae != null) { ae.destroy(); } }
public void close() throws IOException { sender.destroy(); reader.close(); } }
@After public void tearDown() { if (ae != null) { ae.destroy(); } }
@After public void afterMongoRecordConsumerTest() { analysisEngine.destroy(); } }
@After public void tearDown() { if (ae != null) { ae.destroy(); } }
private void destroyAnalysisEngines() { for (AnalysisEngine ae : annotators) { AnalysisEngineActionStore.getInstance() .remove((String) ae.getConfigParameterValue(PipelineBuilder.ANNOTATOR_UUID)); ae.destroy(); } for (AnalysisEngine ae : consumers) { AnalysisEngineActionStore.getInstance() .remove((String) ae.getConfigParameterValue(PipelineBuilder.ANNOTATOR_UUID)); ae.destroy(); } }
@After public void tearDown() { if (ae != null) { ae.destroy(); } }
/** * process the {@link AnnotatorTestBase}'s jCas with the annotator. * * @throws ResourceInitializationException * @throws AnalysisEngineProcessException */ protected void processJCas() throws ResourceInitializationException, AnalysisEngineProcessException { AnalysisEngine analysisEngine = getAnalysisEngine(); analysisEngine.process(jCas); analysisEngine.destroy(); }
public void process() throws UIMAException, IOException{ JCasIterator casIter = new JCasIterator(reader, ae); while(casIter.hasNext()){ JCas jcas = casIter.next(); String docId = DocumentIDAnnotationUtil.getDocumentID(jcas); // extract info from cas processCas(jcas, outputDir + File.separator + docId); } ae.destroy(); }
@After public void afterTest() { ae.destroy(); try { elasticsearch.close(); } catch (IOException ioe) { // Do nothing } elasticsearch = null; }
@After public void afterTest() { if (ae != null) { ae.destroy(); } try { elasticsearch.close(); } catch (final IOException ioe) { // Do nothing } elasticsearch = null; }
@After public void afterElasticsearchRecordConsumerTest() { analysisEngine.destroy(); try { elasticsearch.close(); } catch (IOException ioe) { // Do nothing } } }
@Test public void test() throws Exception { AnalysisEngine rneAE = AnalysisEngineFactory.createEngine( Blacklist.class, Blacklist.PARAM_BLACKLIST, new String[] {NOVEMBER2, LONDON}); createDocument(jCas); rneAE.process(jCas); assertCorrect(1, 0, 1); rneAE.destroy(); }