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

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


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


      InputStream bufByteIn = parseOutput(connection);

      // map alchemy api results to UIMA type system
      try {
        Results results = this.digester.parseAlchemyXML(bufByteIn);
        Validate.notNull(results);
        Validate.notNull(results.getStatus());
        if (this.getContext().getLogger().isLoggable(Level.FINER))
            this.getContext().getLogger().log(Level.FINER, results.toString());
        if (results.getStatus().equalsIgnoreCase(STATUS_OK)) {
          mapResultsToTypeSystem(results, aJCas);
        } else {
          throw new AlchemyCallFailedException(new StringBuilder(results.getStatus()).append(" - ").
                  append(results.getStatusInfo()).toString());
        }

      } catch (Exception e) {
        throw new ResultDigestingException(e);
      } finally {
View Full Code Here

TOP

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

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.