public abstract class CasFilter_ImplBase
extends org.apache.uima.fit.component.JCasMultiplier_ImplBase
pass()
methods to determine whether a JCas should be filtered out or
passed on in a pipeline. Therefore, the pass()
method has to be implemented, returning
true if a document should be passed on in the pipeline and false if it should be filtered out.
The filter (sub-)classes should be applied within a an AggregateBuilder
applying a
FlowController
as in the
createAggregateBuilderDescription(AnalysisEngineDescription...)
method.
Note that methods such as
SimplePipeline.runPipeline(org.apache.uima.cas.CAS, org.apache.uima.analysis_engine.AnalysisEngine...)
and
SimplePipeline.iteratePipeline(org.apache.uima.collection.CollectionReaderDescription, AnalysisEngineDescription...)
do not allow direct access to the JCas' produced by a JCasMultiplier.
Constructor and Description |
---|
CasFilter_ImplBase() |
Modifier and Type | Method and Description |
---|---|
static org.apache.uima.analysis_engine.AnalysisEngineDescription |
createAggregateBuilderDescription(org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines)
Creates a new AnalysisEngineDescription from an Aggregrator that contains all input
AnalysisEngineDescriptions in given order.
|
static org.apache.uima.analysis_engine.AnalysisEngineDescription |
createAggregateBuilderDescription(List<org.apache.uima.analysis_engine.AnalysisEngineDescription> aEngines) |
boolean |
hasNext() |
org.apache.uima.cas.AbstractCas |
next() |
protected abstract boolean |
pass(org.apache.uima.jcas.JCas aJCas)
This method determines whether a document / JCas is removed or retained.
|
void |
process(org.apache.uima.jcas.JCas aJCas) |
getLogger, initialize
getCasInstancesRequired, getEmptyJCas, getRequiredCasInterface, process
public boolean hasNext() throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
public org.apache.uima.cas.AbstractCas next() throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
public void process(org.apache.uima.jcas.JCas aJCas) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
process
in class org.apache.uima.analysis_component.JCasMultiplier_ImplBase
org.apache.uima.analysis_engine.AnalysisEngineProcessException
protected abstract boolean pass(org.apache.uima.jcas.JCas aJCas)
aJCas
- the currently processed JCaspublic static org.apache.uima.analysis_engine.AnalysisEngineDescription createAggregateBuilderDescription(org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines) throws org.apache.uima.resource.ResourceInitializationException
CasFilter_ImplBase
; all subsequent analysis engines will only see the documents that
have passed the filter.aEngines
- AnalysisEngineDescription
s that should be aggregated.AnalysisEngineDescription
aggregating all the input engines.org.apache.uima.resource.ResourceInitializationException
- if any input analysis engine cannot be initializedpublic static org.apache.uima.analysis_engine.AnalysisEngineDescription createAggregateBuilderDescription(List<org.apache.uima.analysis_engine.AnalysisEngineDescription> aEngines) throws org.apache.uima.resource.ResourceInitializationException
aEngines
- a list of AnalysisEngineDescription
sAnalysisEngineDescription
aggregating all the input engines.org.apache.uima.resource.ResourceInitializationException
- if any input analysis engine cannot be initializedcreateAggregateBuilderDescription(AnalysisEngineDescription...)
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.