public class AggregateBuilder extends Object
This is an example taken from our test cases:
import static org.apache.uima.fit.factory.AnalysisEngineFactory.createPrimitiveDescription;
AggregateBuilder builder = new AggregateBuilder();
builder.add(createPrimitiveDescription(Annotator1.class, typeSystemDescription),
ViewNames.PARENTHESES_VIEW, "A");
builder.add(createPrimitiveDescription(Annotator2.class, typeSystemDescription),
ViewNames.SORTED_VIEW, "B",
ViewNames.SORTED_PARENTHESES_VIEW, "C",
ViewNames.PARENTHESES_VIEW, "A");
builder.add(createPrimitiveDescription(Annotator3.class, typeSystemDescription),
ViewNames.INITIAL_VIEW, "B");
AnalysisEngine aggregateEngine = builder.createAggregate();
Constructor and Description |
---|
AggregateBuilder()
The default no-args constructor calls
AggregateBuilder(TypeSystemDescription, TypePriorities, FlowControllerDescription)
with null-valued args. |
AggregateBuilder(org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDescription,
org.apache.uima.resource.metadata.TypePriorities typePriorities,
org.apache.uima.flow.FlowControllerDescription flowControllerDescription)
Instantiate an AggregateBuilder with a given type system, type priorities, and flow controller.
|
Modifier and Type | Method and Description |
---|---|
String |
add(org.apache.uima.analysis_engine.AnalysisEngineDescription aed,
String... viewNames)
This method simply calls
add(String, AnalysisEngineDescription, String...) using the
result of AnalysisEngineDescription.getAnnotatorImplementationName() for the component
name |
void |
add(String componentName,
org.apache.uima.analysis_engine.AnalysisEngineDescription aed,
String... viewNames) |
void |
addSofaMapping(String componentName,
String componentViewName,
String aggregateViewName)
Provide a sofa mapping for a component from the component's view to the aggregate view.
|
org.apache.uima.analysis_engine.AnalysisEngine |
createAggregate()
This method simply delegates to
AnalysisEngineFactory.createEngine(List, TypeSystemDescription, TypePriorities, SofaMapping[], Object...)
with the data collected by this builder. |
org.apache.uima.analysis_engine.AnalysisEngineDescription |
createAggregateDescription()
This method simply delegates to
AnalysisEngineFactory.createEngineDescription(List, TypeSystemDescription, TypePriorities, SofaMapping[], Object...)
with the data collected by this builder. |
void |
setFlowControllerDescription(org.apache.uima.flow.FlowControllerDescription flowControllerDescription)
Set the flow controller description of the aggregate engine created by this builder.
|
public AggregateBuilder()
AggregateBuilder(TypeSystemDescription, TypePriorities, FlowControllerDescription)
with null-valued args.public AggregateBuilder(org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDescription, org.apache.uima.resource.metadata.TypePriorities typePriorities, org.apache.uima.flow.FlowControllerDescription flowControllerDescription)
typeSystemDescription
- this can be instantiated using TypeSystemDescriptionFactory
typePriorities
- this can be instantiated using TypePrioritiesFactory
flowControllerDescription
- this can be instantiated using FlowControllerFactory
public String add(org.apache.uima.analysis_engine.AnalysisEngineDescription aed, String... viewNames)
add(String, AnalysisEngineDescription, String...)
using the
result of AnalysisEngineDescription.getAnnotatorImplementationName()
for the component
nameaed
- an analysis engine description to add to the aggregate analysis engineviewNames
- pairs of view names corresponding to a componentSofaName followed by the
aggregateSofaName that it is mapped to. An even number of names must be passed in or
else an IllegalArgumentException will be thrown. See
SofaMappingFactory.createSofaMapping(String, String, String)
AnalysisEngineDescription
public void add(String componentName, org.apache.uima.analysis_engine.AnalysisEngineDescription aed, String... viewNames)
componentName
- the name of the component to addaed
- an analysis engine description to add to the aggregate analysis engineviewNames
- pairs of view names corresponding to a componentSofaName followed by the
aggregateSofaName that it is mapped to. An even number of names must be passed in or
else an IllegalArgumentException will be thrown. See
SofaMappingFactory.createSofaMapping(String, String, String)
public void addSofaMapping(String componentName, String componentViewName, String aggregateViewName)
componentName
- the name of the componentcomponentViewName
- the name of the component viewaggregateViewName
- the name of the aggregate view to map the component view to.public void setFlowControllerDescription(org.apache.uima.flow.FlowControllerDescription flowControllerDescription)
flowControllerDescription
- see FlowControllerFactory
public org.apache.uima.analysis_engine.AnalysisEngine createAggregate() throws org.apache.uima.resource.ResourceInitializationException
AnalysisEngineFactory.createEngine(List, TypeSystemDescription, TypePriorities, SofaMapping[], Object...)
with the data collected by this builder.org.apache.uima.resource.ResourceInitializationException
- if there is a problem during initializationpublic org.apache.uima.analysis_engine.AnalysisEngineDescription createAggregateDescription() throws org.apache.uima.resource.ResourceInitializationException
AnalysisEngineFactory.createEngineDescription(List, TypeSystemDescription, TypePriorities, SofaMapping[], Object...)
with the data collected by this builder.org.apache.uima.resource.ResourceInitializationException
- if there is a problem during initializationCopyright © 2012–2014 The Apache Software Foundation. All rights reserved.