Examples of UimaAcronym


Examples of org.apache.uima.fit.examples.tutorial.type.UimaAcronym

    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);

    UimaAcronym uimaAcronym = JCasUtil.selectByIndex(jCas, UimaAcronym.class, 0);
    assertNotNull(uimaAcronym);
    assertEquals("CPE", uimaAcronym.getCoveredText());
    assertEquals("Collection Processing Engine", uimaAcronym.getExpandedForm());

    UimaMeeting uimaMeeting = JCasUtil.selectByIndex(jCas, UimaMeeting.class, 0);
    assertNotNull(uimaMeeting);
    assertEquals("Let's meet to talk about the CPE.", uimaMeeting.getCoveredText());
  }
View Full Code Here

Examples of org.apache.uima.fit.examples.tutorial.type.UimaAcronym

      String token = tokenizer.nextToken();
      // look up token in map to see if it is an acronym
      String expandedForm = acronymTable.get(token);
      if (expandedForm != null) {
        // create annotation
        UimaAcronym annot = new UimaAcronym(aJCas, pos, pos + token.length());
        annot.setExpandedForm(expandedForm);
        annot.addToIndexes();
      }
      // incrememnt pos and go to next token
      pos += token.length();
    }
  }
View Full Code Here

Examples of org.apache.uima.tutorial.UimaAcronym

      String token = tokenizer.nextToken();
      // look up token in map to see if it is an acronym
      String expandedForm = mMap.get(token);
      if (expandedForm != null) {
        // create annotation
        UimaAcronym annot = new UimaAcronym(aJCas, pos, pos + token.length(), expandedForm);
        annot.addToIndexes();
      }
      // incrememnt pos and go to next token
      pos += token.length();
    }
  }
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.