google-code-export / uimafit

Automatically exported from code.google.com/p/uimafit
2 stars 1 forks source link

Configuring external resources for non-uimaFIT components is too complex #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For components that do not use the @ExternalResource annotation, uimaFIT cannot 
generate a ExternalResourceDependency. For this reason, bindResource() cannot 
bind an external resource. For a resource to be bound, first a dependency needs 
to be created, added to the descriptor and then the actual resource can be 
bound. This is quite complex. There should be a simple method call taking care 
of this.

Original issue reported on code.google.com by richard.eckart on 17 Apr 2011 at 4:22

GoogleCodeExporter commented 9 years ago
Added createDependencyAndBind() method to take care of this. Example of how to 
configure an OpenNLP compoenent which this:

        AnalysisEngineDescription tokenizer = createPrimitiveDescription(Tokenizer.class,
                UimaUtil.TOKEN_TYPE_PARAMETER, Token.class.getName(),
                UimaUtil.SENTENCE_TYPE_PARAMETER, Sentence.class.getName());
        createDependencyAndBind(tokenizer, UimaUtil.MODEL_PARAMETER,
                TokenizerModelResourceImpl.class,
                "http://opennlp.sourceforge.net/models-1.5/en-token.bin");

Original comment by richard.eckart on 17 Apr 2011 at 4:26