Examples of parseAlchemyXML()


Examples of org.apache.uima.alchemy.digester.categorization.JsonTextCategorizationDigester.parseAlchemyXML()

public class CategorizationJsonDigesterTest extends TestCase {

  public void testParseAlchemyXML() {
    try {
      JsonTextCategorizationDigester digester = new JsonTextCategorizationDigester();
      Results results = digester.parseAlchemyXML(this.getClass().getResourceAsStream(
              "/jsonCategorizationResult.js"));
      assertTrue(results != null);
    } catch (Exception e) {
      e.printStackTrace();
      fail();
View Full Code Here

Examples of org.apache.uima.alchemy.digester.entity.ranked.JsonTextRankedEntityExtractionDigester.parseAlchemyXML()

  public void testParseAlchemyJson() {
    try {
      JsonTextRankedEntityExtractionDigester digester = new JsonTextRankedEntityExtractionDigester();

      EntitiesResults results = (EntitiesResults) digester.parseAlchemyXML(this.getClass()
              .getResourceAsStream("/jsonTextRankedEntityResult.js"));
      assertTrue(results != null);
      assertTrue(results.getLanguage() != null);
      assertTrue(results.getStatus() != null);
      assertTrue(results.getUrl() != null);
View Full Code Here

Examples of org.apache.uima.alchemy.digester.entity.ranked.XMLRankedEntityExtractionDigester.parseAlchemyXML()

              + "<opencyc>LINKED_DATA_OPENCYC</opencyc><umbel>LINKED_DATA_UMBEL</umbel><freebase>LINKED_DATA_FREEBASE</freebase>"
              + "<ciaFactbook>LINKED_DATA_FACTBOOK</ciaFactbook><census>LINKED_DATA_CENSUS</census><geonames>LINKED_DATA_GEONAMES</geonames>"
              + "<musicBrainz>LINKED_DATA_MUSICBRAINZ</musicBrainz></disambiguated><quotations><quotation>ENTITY_QUOTATION</quotation>"
              + "</quotations></entity></entities></results>";
      XMLRankedEntityExtractionDigester digester = new XMLRankedEntityExtractionDigester();
      EntitiesResults results = (EntitiesResults) digester
              .parseAlchemyXML(new ByteArrayInputStream(xmlString.getBytes()));
      assertTrue(results != null);
      assertTrue(results.getLanguage() != null);
      assertTrue(results.getStatus() != null);
      assertTrue(results.getUrl() != null);
View Full Code Here

Examples of org.apache.uima.alchemy.digester.keyword.XMLTextKeywordExctractionDigester.parseAlchemyXML()

  public void testParseAlchemyXML() {
    try {
      String xmlString = "<results><status>OK</status><language>english</language><keywords><keyword>pluto</keyword><keyword>pippo</keyword></keywords></results>";
      XMLTextKeywordExctractionDigester digester = new XMLTextKeywordExctractionDigester();
      KeywordResults results = (KeywordResults) digester.parseAlchemyXML(new ByteArrayInputStream(
              xmlString.getBytes()));
      assertTrue(results != null);
      assertTrue(results.getLanguage() != null);
      assertTrue(results.getStatus() != null);
      assertTrue(results.getKeywords().size() == 2);
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.