@Override public void initialize(UimaContext context) throws ResourceInitializationException { // This will do initialization of resources, // but won't be included in the metrics super.initialize(context); String pipelineName = UimaUtils.getPipelineName(context); monitor = createMonitor(pipelineName); support = createSupport(pipelineName, context); monitor.startFunction("initialize"); doInitialize(context); monitor.finishFunction("initialize"); String uuid = (String) getContext().getConfigParameterValue(PipelineBuilder.ANNOTATOR_UUID); AnalysisEngineActionStore.getInstance().add(uuid, getAction()); }
/** * Add a new annotation, which is merged from the old annotations, removing the old annotations. * * @param newAnnotation The annotation which is to be added to the document as the merged result * of the old annotations * @param annotations Annotation(s) which have been merged and should be removed */ protected void mergeWithNew(Annotation newAnnotation, Annotation... annotations) { getSupport().mergeWithNew(newAnnotation, annotations); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); processor = new CluProcessor(ConfigFactory.load("cluprocessoropen")); }
@Override public void doInitialize(final UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); if (typeNames == null || typeNames.length == 0) { structuralClasses = Sets.newHashSet(DEFAULT_STRUCTURAL_CLASSES); } else { structuralClasses = StructureUtil.getStructureClasses(typeNames); } }
@Override public void destroy() { monitor.startFunction("destroy"); doDestroy(); monitor.finishFunction("destroy"); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { monitor.trace("Starting: " + getClass().getSimpleName()); monitor.startFunction("process"); doProcess(aJCas); monitor.finishFunction("process"); monitor.persistCounts(); monitor.trace("Finished: " + getClass().getSimpleName()); }
@Override public void doInitialize(final UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); if (typeNames == null || typeNames.length == 0) { structuralClasses = Sets.newHashSet(DEFAULT_STRUCTURAL_CLASSES); } else { structuralClasses = StructureUtil.getStructureClasses(typeNames); } }
@Override public void destroy() { monitor.startFunction("destroy"); doDestroy(); monitor.finishFunction("destroy"); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { monitor.trace("Starting: " + getClass().getSimpleName()); monitor.startFunction("process"); doProcess(aJCas); monitor.finishFunction("process"); monitor.persistCounts(); monitor.trace("Finished: " + getClass().getSimpleName()); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { // This will do initialization of resources, // but won't be included in the metrics super.initialize(context); String pipelineName = UimaUtils.getPipelineName(context); monitor = createMonitor(pipelineName); support = createSupport(pipelineName, context); monitor.startFunction("initialize"); doInitialize(context); monitor.finishFunction("initialize"); String uuid = (String) getContext().getConfigParameterValue(PipelineBuilder.ANNOTATOR_UUID); AnalysisEngineActionStore.getInstance().add(uuid, getAction()); }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); try { classifierModel = new FileObject<cc.mallet.classify.Classifier>(modelPath).object(); } catch (Exception e) { throw new ResourceInitializationException(); } }
/** * Merge an existing annotation with old annotations, removing the old annotations. * * @param existingAnnotation The annotation which exists and is to be left in the document * (merged) * @param annotations Annotation(s) which have been merged wiht existingAnnotation and then * removed */ protected void mergeWithExisting(Annotation existingAnnotation, Annotation... annotations) { getSupport().mergeWithExisting(existingAnnotation, annotations); }
@Override protected void doDestroy() { try { candidateSupplier.close(); } catch (Exception e) { getMonitor().warn("Error closing resources", e); } super.doDestroy(); } }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); processor = new CluProcessor(ConfigFactory.load("cluprocessoropen")); }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); try { classifierModel = new FileObject<cc.mallet.classify.Classifier>(modelPath).object(); } catch (Exception e) { throw new ResourceInitializationException(); } }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ protected void addToJCasIndex(Collection<? extends Annotation> annotations) { getSupport().add(annotations); }
@Override protected void doDestroy() { try { candidateSupplier.close(); } catch (Exception e) { getMonitor().warn("Error closing resources", e); } super.doDestroy(); } }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); String rules; try { rules = readFile(); TaxonomyFactory taxonomyFactory = new TaxonomyFactory(includedTypeNames); OdinConfigurationProcessor ruleProcessor = new OdinConfigurationProcessor(taxonomyFactory.create(), rules); ee = ExtractorEngine.fromRules(ruleProcessor.process()); } catch (UIMAException | IOException e) { throw new ResourceInitializationException(e); } }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); try { model = ParallelTopicModel.read(new File(modelPath)); pipe = new TopicModelPipe(stopwordResource.getStopwords(stoplist), model.getAlphabet()); topicWords = new TopicWords(model); } catch (Exception e) { throw new ResourceInitializationException(); } }
/** * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so * * @param annot Annotation(s) to add */ protected void addToJCasIndex(Annotation... annotations) { getSupport().add(annotations); }