throw new AnalysisEngineProcessException( new Exception("No name type or valid name type mapping configured!"));
/** * Initializes the type system. */ public void typeSystemInit(TypeSystem typeSystem) throws AnalysisEngineProcessException { // sentence type // String sentenceTypeName = // AnnotatorUtil.getRequiredStringParameter(mContext, // UimaUtil.SENTENCE_TYPE_PARAMETER); // mSentenceType = AnnotatorUtil.getType(typeSystem, sentenceTypeName); // name type mNameType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, NameFinder.NAME_TYPE_PARAMETER); mStructureFeature = AnnotatorUtil.getRequiredFeatureParameter(context, mNameType, "opennlp.uima.normalizer.StructureFeature"); if (!SUPPORTED_TYPES.contains(mStructureFeature.getRange().getName())) { throw new AnalysisEngineProcessException( ExceptionMessages.MESSAGE_CATALOG, "range_type_unsupported", new Object[] {mStructureFeature.getRange().getName()}); } }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { try { pathWriter.call(); } catch (final Exception e) { throw new AnalysisEngineProcessException(e); } documentAnnotations = null; }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { try { indexWriter.close(); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } } }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { try { endFile(); output.close(); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }
private DataBaseConnector getDataBaseConnector(String costosysConfig) throws AnalysisEngineProcessException { DataBaseConnector dbc; try { dbc = new DataBaseConnector(costosysConfig); } catch (FileNotFoundException e) { throw new AnalysisEngineProcessException(e); } return dbc; }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { try { writer.close(); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } super.collectionProcessComplete(); } }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { try { this.writer.close(); } catch (final IOException e) { // TODO Auto-generated catch block throw new AnalysisEngineProcessException(); } };
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { try (OutputStream docOS = getOutputStream(aJCas, filenameSuffix)) { IOUtils.write(aJCas.getDocumentText(), docOS, targetEncoding); } catch (Exception e) { throw new AnalysisEngineProcessException(e); } } }
@Override public void process(JCas jCas) throws AnalysisEngineProcessException { String id = new File(ViewUriUtil.getURI(jCas)).getName(); File outFile = new File(this.outputDirectory, id + ".txt"); try { FileUtils.saveString2File(jCas.getDocumentText(), outFile); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }
@Override public void process(JCas jcas) throws AnalysisEngineProcessException { try { String locate = RutaModifier.locate(styleMapLocation, descriptorPaths, ".xml", false); if (locate != null) { styleMapFactory.createStyleMap(locate, jcas); } } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }
/** * {@inheritDoc} */ @Override public void process( final CAS aCAS ) throws AnalysisEngineProcessException { try { final JCas jcas = aCAS.getJCas(); process( jcas ); } catch ( CASException casE ) { throw new AnalysisEngineProcessException( casE ); } }
private void implementsFeatureExtractorInterface(String featExt, FeatureExtractorResource_ImplBase featExtC) throws AnalysisEngineProcessException { if (!(featExtC instanceof FeatureExtractor)) { throw new AnalysisEngineProcessException(new TextClassificationException( featExt + " is not a valid feature extractor.")); } }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { try { processInstances(aJCas); processOutcome(aJCas); } catch (Exception e) { throw new AnalysisEngineProcessException(e); } }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { try { processSequences(aJCas); processOutcome(aJCas); } catch (Exception e) { throw new AnalysisEngineProcessException(e); } }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { DocumentMetaData dmd = JCasUtil.selectSingle(aJCas, DocumentMetaData.class); try { bw.write(dmd.getDocumentId() + "\t" + aJCas.getDocumentText() + "\n"); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }
@Override public void process( JCas jCas ) throws AnalysisEngineProcessException { try { JCas goldView = jCas.getView( GOLD_VIEW_NAME ); goldView.setDocumentText( jCas.getDocumentText() ); } catch ( CASException e ) { throw new AnalysisEngineProcessException( e ); } } }
@Override public void update(Key key, String sequenceId, List<T> docs, List<T> gs, Ordering<T> ordering, Function<T, String> toIdString) throws AnalysisEngineProcessException { RetrievalCounts cnt = count(docs, gs, ordering, toIdString); try { persistence.deletePassageAggrEval(key, sequenceId); persistence.insertPartialCounts(key, sequenceId, cnt); } catch (Exception e) { throw new AnalysisEngineProcessException(e); } }
@Override protected void outputModel(String documentSourceName, OntModel model) throws AnalysisEngineProcessException { try (OutputStream outputStream = createOutputStream(documentSourceName)) { model.write(outputStream, rdfFormat.getKey()); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } } }
@Override public void process(CAS aCAS) throws AnalysisEngineProcessException { try { JCas jcas = aCAS.getJCas(); ExperimentUUID experiment = ProcessingStepUtils.getCurrentExperiment(jcas); experiments.add(new ExperimentKey(experiment.getUuid(), experiment.getStageId())); } catch (Exception e) { throw new AnalysisEngineProcessException(e); } }