/** * Use of this method is order-specific. * * @param description ae or cc component class description to add to the pipeline * @return this PipelineBuilder */ public PipelineBuilder addDescription( final AnalysisEngineDescription description ) { _aeNameList.add( description.getAnnotatorImplementationName() ); _descList.add( description ); _pipelineChanged = true; return this; }
/** * Use of this method is order-specific. * * @param description ae or cc component class description to add to the pipeline * @param views cas views to use for the component * @return this PipelineBuilder */ public PipelineBuilder addDescription( final AnalysisEngineDescription description, final Collection<String> views ) { _aeNameList.add( description.getAnnotatorImplementationName() ); _aeViewList.add( toStringArray( views ) ); _descList.add( description ); _pipelineChanged = true; return this; }
public static void testOneWay(CollectionReaderDescription aReader, AnalysisEngineDescription aWriter, String aExpectedFile, String aFile, TestOptions aOptions) throws Exception { Class<?> dkproReaderBase = Class.forName(RESOURCE_COLLECTION_READER_BASE); if (!dkproReaderBase.isAssignableFrom(Class.forName(aReader.getImplementationName()))) { throw new IllegalArgumentException("Reader must be a subclass of [" + RESOURCE_COLLECTION_READER_BASE + "]"); } Class<?> dkproWriterBase = Class.forName(JCAS_FILE_WRITER_IMPL_BASE); if (!dkproWriterBase .isAssignableFrom(Class.forName(aWriter.getAnnotatorImplementationName()))) { throw new IllegalArgumentException("writer must be a subclass of [" + JCAS_FILE_WRITER_IMPL_BASE + "]"); } // We assume that the writer is creating a file with the same extension as is provided as // the expected file String extension = FilenameUtils.getExtension(aExpectedFile); String name = FilenameUtils.getBaseName(aFile); testOneWay2(aReader, aWriter, aExpectedFile, name + "." + extension, aFile, aOptions); }
public static void testOneWay(CollectionReaderDescription aReader, AnalysisEngineDescription aWriter, String aExpectedFile, String aFile, TestOptions aOptions) throws Exception { Class<?> dkproReaderBase = Class.forName(RESOURCE_COLLECTION_READER_BASE); if (!dkproReaderBase.isAssignableFrom(Class.forName(aReader.getImplementationName()))) { throw new IllegalArgumentException("Reader must be a subclass of [" + RESOURCE_COLLECTION_READER_BASE + "]"); } Class<?> dkproWriterBase = Class.forName(JCAS_FILE_WRITER_IMPL_BASE); if (!dkproWriterBase .isAssignableFrom(Class.forName(aWriter.getAnnotatorImplementationName()))) { throw new IllegalArgumentException("writer must be a subclass of [" + JCAS_FILE_WRITER_IMPL_BASE + "]"); } // We assume that the writer is creating a file with the same extension as is provided as // the expected file String extension = FilenameUtils.getExtension(aExpectedFile); String name = FilenameUtils.getBaseName(aFile); testOneWay2(aReader, aWriter, aExpectedFile, name + "." + extension, aFile, aOptions); }
/** * @param mainDescription main component description * @return Description that is wrapped with a simple Logger AE that logs the Start and Finish of the process * @throws ResourceInitializationException if UimaFit has a problem */ public static AnalysisEngineDescription createLoggedDescription( final AnalysisEngineDescription mainDescription ) throws ResourceInitializationException { final String name = mainDescription.getAnnotatorImplementationName(); return AnalysisEngineFactory.createEngineDescription( createDescription( name, true ), mainDescription, createDescription( name, false ) ); }
/** * @param mainDescription main component description * @return Description that is wrapped with a simple Logger AE that logs the Start and Finish of the process * @throws ResourceInitializationException if UimaFit has a problem */ public static AnalysisEngineDescription createLoggedDescription( final AnalysisEngineDescription mainDescription ) throws ResourceInitializationException { final String name = mainDescription.getAnnotatorImplementationName(); return AnalysisEngineFactory.createEngineDescription( createDescription( name, true ), mainDescription, createDescription( name, false ) ); }
/** * This method simply calls {@link #add(String, AnalysisEngineDescription, String...)} using the * result of {@link AnalysisEngineDescription#getAnnotatorImplementationName()} for the component * name * * @param aed * an analysis engine description to add to the aggregate analysis engine * @param viewNames * 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 * {@link SofaMappingFactory#createSofaMapping(String, String, String)} * * @return the name of the component generated for the {@link AnalysisEngineDescription} */ public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; }
/** * Link local processing descriptors from ae. * * @param d the d */ // ************************************************************** private void linkLocalProcessingDescriptorsFromAe(CollectionReaderDescription d) { d.setImplementationName(aeDescription.getAnnotatorImplementationName()); d.setFrameworkImplementation(aeDescription.getFrameworkImplementation()); linkCommonCollectionDescriptorsFromAe(d); }
/** * Link local processing descriptors from ae. * * @param d the d */ private void linkLocalProcessingDescriptorsFromAe(CasInitializerDescription d) { d.setImplementationName(aeDescription.getAnnotatorImplementationName()); d.setFrameworkImplementation(aeDescription.getFrameworkImplementation()); linkCommonCollectionDescriptorsFromAe(d); }
/** * Link local processing descriptors from ae. * * @param d the d */ private void linkLocalProcessingDescriptorsFromAe(FlowControllerDescription d) { d.setImplementationName(aeDescription.getAnnotatorImplementationName()); d.setFrameworkImplementation(aeDescription.getFrameworkImplementation()); linkCommonCollectionDescriptorsFromAe(d); }
/** * Link local processing descriptors from ae. * * @param d the d */ private void linkLocalProcessingDescriptorsFromAe(CasConsumerDescription d) { d.setImplementationName(aeDescription.getAnnotatorImplementationName()); d.setFrameworkImplementation(aeDescription.getFrameworkImplementation()); linkCommonCollectionDescriptorsFromAe(d); }
public static void testOneWay(CollectionReaderDescription aReader, AnalysisEngineDescription aWriter, String aExpectedFile, String aFile, TestOptions aOptions) throws Exception { Class<?> dkproReaderBase = Class.forName(RESOURCE_COLLECTION_READER_BASE); if (!dkproReaderBase.isAssignableFrom(Class.forName(aReader.getImplementationName()))) { throw new IllegalArgumentException("Reader must be a subclass of [" + RESOURCE_COLLECTION_READER_BASE + "]"); } Class<?> dkproWriterBase = Class.forName(JCAS_FILE_WRITER_IMPL_BASE); if (!dkproWriterBase .isAssignableFrom(Class.forName(aWriter.getAnnotatorImplementationName()))) { throw new IllegalArgumentException("writer must be a subclass of [" + JCAS_FILE_WRITER_IMPL_BASE + "]"); } // We assume that the writer is creating a file with the same extension as is provided as // the expected file String extension = FilenameUtils.getExtension(aExpectedFile); String name = FilenameUtils.getBaseName(aFile); testOneWay2(aReader, aWriter, aExpectedFile, name + "." + extension, aFile, aOptions); }
/** * Checks that this @param aed is provided with the right {@link Annotation} * s in the upstream of this pipeline, and prints an error log otherwise. * Add this aed's capabilities for other downstream aeds. */ private void checkAndAddCapabilities(AnalysisEngineDescription aed) { for (Capability capability : aed.getAnalysisEngineMetaData() .getCapabilities()) { for (TypeOrFeature input : capability.getInputs()) if (!outputTypes.contains(input.getName())) LOG.error("AnalysisEngine " + aed.getAnnotatorImplementationName() + " is missing input @TypeCapability: " + input.getName()); } for (Capability capability : aed.getAnalysisEngineMetaData() .getCapabilities()) { for (TypeOrFeature output : capability.getOutputs()) { // LOG.info("add @TypeCapability: " + output.getName()); outputTypes.add(output.getName()); } } }
String modelImplName = editor.getAeDescription().getAnnotatorImplementationName(); implName.setText(convertNull(modelImplName)); this.getSection().layout();
editor.getAeDescription().setAnnotatorImplementationName( setValueChanged(implName.getText(), editor.getAeDescription() .getAnnotatorImplementationName()));