Package org.apache.uima.alchemy.digester.domain

Examples of org.apache.uima.alchemy.digester.domain.EntitiesResults


              + "<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);
      assertTrue(results.getEntities() != null);
      assertTrue(results.getEntities().getEntities() != null);
      assertTrue(results.getEntities().getEntities().size() > 0);
      assertTrue(results.getEntities().getEntities().size() == 1);
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here


  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);
      assertTrue(results.getEntities() != null);
      assertTrue(results.getEntities().getEntities() != null);
      assertTrue(results.getEntities().getEntities().size() > 0);
      assertTrue(results.getEntities().getEntities().size() == 2);
      assertTrue(results.getEntities().getEntities().get(1).getDisambiguated() != null);
      assertTrue(results.getEntities().getEntities().get(1).getDisambiguated().getDbpedia().equals(
              "http://dbpedia.org/resource/United_States"));
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    }
View Full Code Here

TOP

Related Classes of org.apache.uima.alchemy.digester.domain.EntitiesResults

Copyright © 2018 www.massapicom. 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.