public final class PipelineBuilder extends Object
Some methods are order-specific and calls will directly impact ordering within the pipeline.
Constructor and Description |
---|
PipelineBuilder() |
Modifier and Type | Method and Description |
---|---|
PipelineBuilder |
add(Class<? extends org.apache.uima.analysis_component.AnalysisComponent> component,
Object... parameters)
Use of this method is order-specific.
|
PipelineBuilder |
addDescription(org.apache.uima.analysis_engine.AnalysisEngineDescription description)
Use of this method is order-specific.
|
PipelineBuilder |
addLast(Class<? extends org.apache.uima.analysis_component.AnalysisComponent> component,
Object... parameters)
Adds an ae or cc component t othe very end of the pipeline.
|
PipelineBuilder |
addLogged(Class<? extends org.apache.uima.analysis_component.AnalysisComponent> component,
Object... parameters)
Adds an ae or cc wrapped with "Starting processing" and "Finished processing" log messages
Use of this method is order-specific.
|
PipelineBuilder |
build()
Initialize a pipeline that can be used repeatedly using
run() and run(String) . |
void |
clear() |
PipelineBuilder |
collectCuis()
Adds ae that maintains CUI information throughout the run.
|
PipelineBuilder |
collectEntities()
Adds ae that maintains simple Entity information throughout the run.
|
List<String> |
getAeNames() |
org.apache.uima.analysis_engine.AnalysisEngineDescription |
getAnalysisEngineDesc() |
org.apache.uima.collection.CollectionReaderDescription |
getReader() |
PipelineBuilder |
reader(Class<? extends org.apache.uima.collection.CollectionReader> readerClass,
Object... parameters)
Use of this method is not order-specific
|
PipelineBuilder |
reader(org.apache.uima.collection.CollectionReaderDescription description)
Use of this method is not order-specific
|
PipelineBuilder |
readFiles()
Adds a Collection reader to the beginning of the pipeline that will read files in a directory tree.
|
PipelineBuilder |
readFiles(String inputDirectory)
Adds a Collection reader to the beginning of the pipeline that will read files in a directory tree.
|
PipelineBuilder |
run()
Run the pipeline using some specified collection reader.
|
PipelineBuilder |
run(String text)
Run the pipeline on the given text.
|
PipelineBuilder |
set(Object... parameters)
Use of this method is order-specific
|
PipelineBuilder |
writeXMIs()
Adds ae that writes an xmi file at the end of the pipeline.
|
PipelineBuilder |
writeXMIs(String outputDirectory)
Adds ae that writes an xmi file at the end of the pipeline.
|
public void clear()
public PipelineBuilder set(Object... parameters)
parameters
- add ae parameter name value pairspublic PipelineBuilder reader(org.apache.uima.collection.CollectionReaderDescription description)
description
- Collection Reader Description to place at the beginning of the pipelinepublic PipelineBuilder reader(Class<? extends org.apache.uima.collection.CollectionReader> readerClass, Object... parameters) throws org.apache.uima.UIMAException
readerClass
- Collection Reader class to place at the beginning of the pipelineparameters
- reader parameter name value pairs. May be empty.org.apache.uima.UIMAException
public PipelineBuilder readFiles() throws org.apache.uima.UIMAException
ConfigParameterConstants.PARAM_INPUTDIR
having been specified
Use of this method is not order-specific.org.apache.uima.UIMAException
- if the collection reader cannot be createdpublic PipelineBuilder readFiles(String inputDirectory) throws org.apache.uima.UIMAException
inputDirectory
- directory with input filesorg.apache.uima.UIMAException
- if the collection reader cannot be createdpublic org.apache.uima.collection.CollectionReaderDescription getReader()
public PipelineBuilder add(Class<? extends org.apache.uima.analysis_component.AnalysisComponent> component, Object... parameters) throws org.apache.uima.resource.ResourceInitializationException
component
- ae or cc component class to add to the pipelineparameters
- ae or cc parameter name value pairs. May be empty.org.apache.uima.resource.ResourceInitializationException
- if the component cannot be createdpublic PipelineBuilder addLogged(Class<? extends org.apache.uima.analysis_component.AnalysisComponent> component, Object... parameters) throws org.apache.uima.resource.ResourceInitializationException
component
- ae or cc component class to add to the pipelineparameters
- ae or cc parameter name value pairs. May be empty.org.apache.uima.resource.ResourceInitializationException
- if the component cannot be createdpublic PipelineBuilder addDescription(org.apache.uima.analysis_engine.AnalysisEngineDescription description)
description
- ae or cc component class description to add to the pipelinepublic PipelineBuilder addLast(Class<? extends org.apache.uima.analysis_component.AnalysisComponent> component, Object... parameters) throws org.apache.uima.resource.ResourceInitializationException
component
- ae or cc component class to add to the end of the pipelineparameters
- ae or cc parameter name value pairs. May be empty.org.apache.uima.resource.ResourceInitializationException
- if the component cannot be createdpublic List<String> getAeNames()
public PipelineBuilder collectCuis() throws org.apache.uima.resource.ResourceInitializationException
CuiCollector
singleton
Use of this method is order-specific.org.apache.uima.resource.ResourceInitializationException
- if the CuiCollector engine cannot be createdpublic PipelineBuilder collectEntities() throws org.apache.uima.resource.ResourceInitializationException
EntityCollector
singleton
Use of this method is order-specific.org.apache.uima.resource.ResourceInitializationException
- if the EntityCollector engine cannot be createdpublic PipelineBuilder writeXMIs() throws org.apache.uima.resource.ResourceInitializationException
ConfigParameterConstants.PARAM_OUTPUTDIR
having been specified
Use of this method is order-specific.org.apache.uima.resource.ResourceInitializationException
- if the Xmi writer engine cannot be createdpublic PipelineBuilder writeXMIs(String outputDirectory) throws org.apache.uima.resource.ResourceInitializationException
outputDirectory
- directory in which xmi files should be writtenorg.apache.uima.resource.ResourceInitializationException
- if the Xmi writer engine cannot be createdpublic PipelineBuilder build() throws IOException, org.apache.uima.UIMAException
run()
and run(String)
.
A pipeline can be extended between builds, but the full pipeline will be rebuilt on each call.
Use of this method is order-specific.IOException
- if the pipeline could not be builtorg.apache.uima.UIMAException
- if the pipeline could not be builtpublic PipelineBuilder run() throws IOException, org.apache.uima.UIMAException
build()
if the pipeline has not already been initialized.IOException
- if the pipeline could not be runorg.apache.uima.UIMAException
- if the pipeline could not be runpublic PipelineBuilder run(String text) throws IOException, org.apache.uima.UIMAException
build()
if the pipeline has not already been initialized.text
- text upon which to run this pipelineIOException
- if the pipeline could not be runorg.apache.uima.UIMAException
- if the pipeline could not be runpublic org.apache.uima.analysis_engine.AnalysisEngineDescription getAnalysisEngineDesc() throws IOException, org.apache.uima.UIMAException
IOException
- if the description could not be builtorg.apache.uima.UIMAException
- if the description could not be builtCopyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.