Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.AnalysisEngineProcessException


    InputStream in = null;
    try {
      in = aCAS.getSofaDataStream();
      bytes = IOUtils.toByteArray(in);
    } catch (IOException e) {
      throw new AnalysisEngineProcessException(e);
    } finally {
      IOUtils.closeQuietly(in);
    }
    if (bytes != null) {
      // Data size
View Full Code Here


        return aJCas.getView(aViewName);
      } catch (CASRuntimeException ce) {
        return aJCas.createView(aViewName);
      }
    } catch (CASException ce) {
      throw new AnalysisEngineProcessException(ce);
    }
  }
View Full Code Here

        DataResource configuredResource = (DataResource) getContext().getResourceObject(RES_KEY_3,
                new String[] { ConfigurableDataResource.PARAM_URI, "http://dum.my/conf" });
        assertNotNull(configuredResource);
        assertEquals("http://dum.my/conf.lala", configuredResource.getUri().toString());
      } catch (ResourceAccessException e) {
        throw new AnalysisEngineProcessException(e);
      }

      assertNotNull(sharedObject);
      assertEquals("3", sharedObject.getValue());

      assertNotNull(sharedObject);
      assertEquals(EX_URI, sharedObject.getUrl().toString());

      assertNotNull(jndiPropertes);
      assertEquals("proper noun", jndiPropertes.get("Hans"));

      assertNotNull(someUrl);
      assertEquals(new File(EX_FILE_1).toURI().toString(), someUrl.getUri().toString());

      assertNotNull(someOtherUrl);
      assertEquals(new File(EX_FILE_3).toURI().toString(), someOtherUrl.getUri().toString());

      assertTrue(someFile.getUrl().toString().startsWith("file:"));
      assertTrue("URL [" + someFile.getUrl() + "] should end in [" + EX_FILE_1 + "]", someFile
              .getUrl().toString().endsWith(EX_FILE_1));

      try {
        assertNotNull(getContext().getResourceObject("legacyResource"));
      } catch (ResourceAccessException e) {
        throw new AnalysisEngineProcessException(e);
      }
    }
View Full Code Here

      // get the gold view
      JCas goldView;
      try {
        goldView = jCas.getView(GOLD_VIEW_NAME);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
      }

      // get the gold and system annotations
      Collection<BinaryTextRelation> goldBinaryTextRelations = JCasUtil.select(
          goldView,
View Full Code Here

      JCas initView;
      try {
        initView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
      }
      String goldFilePath = inputDirectory + DocumentIDAnnotationUtil.getDocumentID(jCas) + ".knowtator.xml";
     
      SAXBuilder builder = new SAXBuilder();
      Document document;
      try {
        document = builder.build(new File(goldFilePath));
      } catch (Exception e) {
        throw new AnalysisEngineProcessException(e);
      }
     
      // map knowtator mention ids to entity offsets
      HashMap<String, ArrayList<Span>> entityMentions = XMLReader.getEntityMentions(document);
      // map knowtator mention ids to entity types
View Full Code Here

    if (! this.isTraining() && printErrors) {
      JCas goldView;
      try {
        goldView = jCas.getView("GoldView");
      } catch(CASException e) {
        throw new AnalysisEngineProcessException(e);
      }
     
      categoryLookup = createCategoryLookup(goldView);
    }
   
    JCas identifiedAnnotationView, relationView;
    if (this.isTraining()) {
      try {
        identifiedAnnotationView = relationView = jCas.getView(this.goldViewName);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
      }
    } else {
      identifiedAnnotationView = relationView = jCas;
    }
View Full Code Here

      JCas goldView, systemView;
      try {
        goldView = jCas.getView(GOLD_VIEW_NAME);
        systemView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
      }

      // remove cTAKES EntityMentions and Modifiers from system view
      List<IdentifiedAnnotation> cTakesMentions = new ArrayList<IdentifiedAnnotation>();
      cTakesMentions.addAll(JCasUtil.select(systemView, EntityMention.class));
View Full Code Here

    SAXBuilder builder = new SAXBuilder();
    Document document;
    try {
      document = builder.build(goldFile);
    } catch (Exception e) {
      throw new AnalysisEngineProcessException(e);
    }

    // map knowtator mention ids to entity offsets (ArrayList needed to handle disjoint spans)
    HashMap<String, ArrayList<Span>> entityMentions = XMLReader.getEntityMentions(document);
    // map knowtator mention ids to entity types
View Full Code Here

      JCas goldView, systemView;
      try {
        goldView = jCas.getView(GOLD_VIEW_NAME);
        systemView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
      }

      // remove manual EntityMentions and Modifiers from gold view
      List<IdentifiedAnnotation> goldMentions = new ArrayList<IdentifiedAnnotation>();
      goldMentions.addAll(JCasUtil.select(goldView, EntityMention.class));
View Full Code Here

    for (JCas jCas : new JCasIterable(collectionReader, classifierAnnotator)) {
      JCas goldView;
      try {
        goldView = jCas.getView(GOLD_VIEW_NAME);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
      }
      Collection<Modifier> goldModifiers = JCasUtil.select(goldView, Modifier.class);
      Collection<Modifier> systemModifiers = JCasUtil.select(jCas, Modifier.class);
      stats.add(goldModifiers, systemModifiers);
    }
View Full Code Here

TOP

Related Classes of org.apache.uima.analysis_engine.AnalysisEngineProcessException

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.