/** * @param flowControllerClass * the flow controller class * @param configurationParameters * the configuration parameters * @param configurationValues * the configuration parameter values * @return a flow controller description * @throws ResourceInitializationException * if the description could not be created */ public static FlowControllerDescription createFlowControllerDescription( Class<? extends FlowController> flowControllerClass, ConfigurationParameter[] configurationParameters, Object[] configurationValues) throws ResourceInitializationException { return createFlowControllerDescription(flowControllerClass, configurationParameters, configurationValues, null); }
/** * Creates a new FlowControllerDescription for a given class and configuration data * * @param flowControllerClass * the flow controller class * @param configurationData * should be configuration parameter name / value pairs. * @return a flow controller description * @throws ResourceInitializationException * if the description could not be created */ public static FlowControllerDescription createFlowControllerDescription( Class<? extends FlowController> flowControllerClass, Object... configurationData) throws ResourceInitializationException { ensureParametersComeInPairs(configurationData); // Extract ExternalResourceDescriptions from configurationData // <ParamterName, ExternalResourceDescription> will be stored in this map Map<String, ExternalResourceDescription> externalResources = ExternalResourceFactory .extractExternalResourceParameters(configurationData); // Create description normally ConfigurationData cdata = createConfigurationData(configurationData); return createFlowControllerDescription(flowControllerClass, cdata.configurationParameters, cdata.configurationValues, externalResources); }
/** * Creates a new AnalysisEngineDescription from an Aggregrator that contains all input * AnalysisEngineDescriptions in given order. This is intended for the use of a filter like * {@link CasFilter_ImplBase}; all subsequent analysis engines will only see the documents that * have passed the filter. * * @param aEngines * {@link AnalysisEngineDescription}s that should be aggregated. * @return a single {@link AnalysisEngineDescription} aggregating all the input engines. * @throws ResourceInitializationException * if any input analysis engine cannot be initialized */ public static AnalysisEngineDescription createAggregateBuilderDescription( AnalysisEngineDescription... aEngines) throws ResourceInitializationException { AggregateBuilder aggregateBuilder = new AggregateBuilder(); aggregateBuilder.setFlowControllerDescription(FlowControllerFactory .createFlowControllerDescription(FixedFlowController.class, FixedFlowController.PARAM_ACTION_AFTER_CAS_MULTIPLIER, "drop")); for (AnalysisEngineDescription aEngine : aEngines) { aggregateBuilder.add(aEngine); } return aggregateBuilder.createAggregateDescription(); }
FlowControllerFactory.createFlowControllerDescription( FixedFlowController.class,
FlowControllerDescription corefFlowControl = FlowControllerFactory.createFlowControllerDescription(CorefEvalFlowController.class); aggregateBuilder.setFlowControllerDescription(corefFlowControl);
this.outputDirectory + systemOut)); FlowControllerDescription corefFlowControl = FlowControllerFactory.createFlowControllerDescription(CorefEvalFlowController.class); aggregateBuilder.setFlowControllerDescription(corefFlowControl);
@Override public AnalysisEngine buildPipeline(AnyObject config, String pipeline, int stageId, FixedFlow funnel, boolean outputNewCASes) throws Exception { loadTypePriorities(config); Iterable<AnyObject> iterable = config.getIterable(pipeline); FlowControllerDescription fcd = FlowControllerFactory .createFlowControllerDescription(FixedFlowController797182.class); AnalysisEngineDescription aee = buildPipeline(stageId, iterable, fcd); if (funnel != null) { FixedFlow fc = (FixedFlow) aee.getAnalysisEngineMetaData().getFlowConstraints(); funnel.setFixedFlow(fc.getFixedFlow()); aee.getAnalysisEngineMetaData().setFlowConstraints(funnel); } aee.getAnalysisEngineMetaData().getOperationalProperties().setOutputsNewCASes(outputNewCASes); aee.getAnalysisEngineMetaData().setName(pipeline); return AnalysisEngineFactory.createAggregate(aee); }