Package org.apache.uima.analysis_engine

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


      } catch (Exception e) {
        if (cas != null) {
          cas.release();
        }
        if (ae != null) {
          ae.destroy();
        }
        clearConsoleLink(handler);
        String message = e.getMessage();
        DLTKCore.error(message, e);
        throw new CoreException(new Status(IStatus.ERROR, RutaIdeUIPlugin.PLUGIN_ID,
View Full Code Here


    }
    if (cas != null) {
      cas.release();
    }
    if (ae != null) {
      ae.destroy();
    }
    IFolder folder = outputFolder;
    folder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
    clearConsoleLink(handler);
    mon.done();
View Full Code Here

    }

    ae.batchProcessComplete(new ProcessTrace_impl());
    ae.collectionProcessComplete(new ProcessTrace_impl());
    cas.release();
    ae.destroy();
  }

  private static void processFile(File file, AnalysisEngine ae, CAS cas) throws IOException,
          AnalysisEngineProcessException, SAXException {
    if (view != null) {
View Full Code Here

    t1 = cas4.getTypeSystem().getType(TEST_TYPE);
    assertEquals(1, cas4.getAnnotationIndex(t1).size());
   
    if (ae != null) {
      ae.destroy();
    }
    if (cas != null) {
      cas.release();
    }
    if (cas2 != null) {
View Full Code Here

      // we are expecting an IllegalArgumentException because both org.apache.uima.ruta.type.W and
      // org.apache.uima.ruta.type.conflicting.W are imported into RUTA's namespace as W;
      assertTrue(e.getCause() instanceof IllegalArgumentException);
    } finally {
        cas.release();
        ae.destroy();
    }
  }
}
View Full Code Here

      cas.setDocumentText("Word");
      ae.process(cas);

      assertEquals(Arrays.asList("Word"), selectText(cas, "org.apache.uima.ruta.Type1"));
    } finally {
      ae.destroy();
    }
  }

  @Test
  public void testImportTypeFromDefaultTypesystem() throws Exception {
View Full Code Here

      cas.setDocumentText("Word");
      ae.process(cas);

      assertEquals(Arrays.asList("Word"), selectText(cas, "org.apache.uima.ruta.Type1"));
    } finally {
      ae.destroy();
    }
  }

  @Test
  public void testUnimportedTypesAreNotResolved() throws Exception {
View Full Code Here

      fail("Type2 should not be resolved because it is not imported.");
    } catch (AnalysisEngineProcessException e) {
      // success, Type2 should not be resolved
    } finally {
      ae.destroy();
    }
  }

  @Test
  public void testImportTypeAs() throws Exception {
View Full Code Here

      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.Type2"));
    } finally {
      ae.destroy();
    }

  }

  @Test
View Full Code Here

      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.Type2"));
    } finally {
      ae.destroy();
    }
  }

  @Test
  public void testImportStarFromTypeSystem() throws Exception {
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.