Examples of newJCas()


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

    log.info(new StringBuffer("Analazying text").toString());
    /* get the UIMA analysis engine */
    AnalysisEngine ae = aeProvider.getAE();

    /* create a JCas which contain the text to analyze */
    JCas jcas = ae.newJCas();
    jcas.setDocumentText(textFieldValue);

    /* perform analysis on text field */
    ae.process(jcas);
    log.info(new StringBuilder("Text processing completed").toString());
View Full Code Here

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

            RutaEngine.PARAM_MAIN_SCRIPT, "org.apache.uima.ruta.engine.UimafitTest",
            // Path(s) where the scripts are located
            RutaEngine.PARAM_SCRIPT_PATHS, new String[] { "src/test/resources" });

    // Create a CAS from the AE so it has the required type priorities
    JCas jcas = ae.newJCas();

    // Fill the CAS with some tokens
    JCasBuilder builder = new JCasBuilder(jcas);
    builder.add("This", TruePositive.class);
    builder.add(" ");
View Full Code Here

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

            UimaAcronymAnnotator.RES_ACRONYM_TABLE, resource));
    builder.add(createEngineDescription(UimaMeetingAnnotator.class,
            UimaMeetingAnnotator.RES_UIMA_TERM_TABLE, resource));
    AnalysisEngine engine = createEngine(builder.createAggregateDescription());

    JCas jCas = engine.newJCas();
    jCas.setDocumentText("Let's meet to talk about the CPE. The meeting is over at Yorktown 01-144");
    new Meeting(jCas, 0, 33).addToIndexes();

    engine.process(jCas);
View Full Code Here

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

   */
  @Test
  public void testRNA1() throws Exception {
    AnalysisEngine roomNumberAnnotatorAE = AnalysisEngineFactory
            .createEngine("org.apache.uima.fit.examples.tutorial.ex1.RoomNumberAnnotator");
    JCas jCas = roomNumberAnnotatorAE.newJCas();
    jCas.setDocumentText("The meeting is over at Yorktown 01-144");
    roomNumberAnnotatorAE.process(jCas);

    RoomNumber roomNumber = JCasUtil.selectByIndex(jCas, RoomNumber.class, 0);
    assertNotNull(roomNumber);
View Full Code Here

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

  public void testRNA2() throws Exception {
    TypeSystemDescription typeSystemDescription = TypeSystemDescriptionFactory
            .createTypeSystemDescription("org.apache.uima.fit.examples.TypeSystem");
    AnalysisEngine roomNumberAnnotatorAE = AnalysisEngineFactory.createEngine(
            RoomNumberAnnotator.class, typeSystemDescription);
    JCas jCas = roomNumberAnnotatorAE.newJCas();
    jCas.setDocumentText("The meeting is over at Yorktown 01-144");
    roomNumberAnnotatorAE.process(jCas);

    RoomNumber roomNumber = JCasUtil.selectByIndex(jCas, RoomNumber.class, 0);
    assertNotNull(roomNumber);
View Full Code Here

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

   */
  @Test
  public void testRNA3() throws Exception {
    AnalysisEngine roomNumberAnnotatorAE = AnalysisEngineFactory
            .createEngine(RoomNumberAnnotator.class);
    JCas jCas = roomNumberAnnotatorAE.newJCas();
    jCas.setDocumentText("The meeting is over at Yorktown 01-144");
    roomNumberAnnotatorAE.process(jCas);

    RoomNumber roomNumber = JCasUtil.selectByIndex(jCas, RoomNumber.class, 0);
    assertNotNull(roomNumber);
View Full Code Here

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

    TypePriorityList typePriorityList = typePriorities.getPriorityLists()[0];
    assertEquals(2, typePriorityList.getTypes().length);
    assertEquals("org.apache.uima.fit.type.Token", typePriorityList.getTypes()[0]);
    assertEquals("org.apache.uima.fit.type.Sentence", typePriorityList.getTypes()[1]);

    jCas = engine.newJCas();
    tokenBuilder.buildTokens(jCas, "word");
    FSIterator<Annotation> tokensInSentence = jCas.getAnnotationIndex().subiterator(
            JCasUtil.selectByIndex(jCas, Sentence.class, 0));
    assertFalse(tokensInSentence.hasNext());
View Full Code Here

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

    prioritizedTypeNames = new String[] { "org.apache.uima.fit.type.Sentence",
        "org.apache.uima.fit.type.Token" };
    engine = AnalysisEngineFactory.createEngine(
            org.apache.uima.fit.component.NoOpAnnotator.class, typeSystemDescription,
            prioritizedTypeNames, (Object[]) null);
    jCas = engine.newJCas();
    tokenBuilder.buildTokens(jCas, "word");
    tokensInSentence = jCas.getAnnotationIndex().subiterator(
            JCasUtil.selectByIndex(jCas, Sentence.class, 0));
    assertTrue(tokensInSentence.hasNext());
View Full Code Here

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

    assertFalse(resMgr.isAutoWireEnabled());

    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(desc, resMgr, null);
    assertNotNull(ae);

    ae.process(ae.newJCas());
  }

  @Test
  public void testDirectInjectionAutowire() throws Exception {
    // Create analysis enginge description
View Full Code Here

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

    assertTrue(resMgr.isAutoWireEnabled());

    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(desc, resMgr, null);
    assertNotNull(ae);

    ae.process(ae.newJCas());
  }

  @Test
  public void testMultiBinding() throws Exception {
    ExternalResourceDescription extDesc = createExternalResourceDescription(DummyResource.class);
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.