On 01/28/2010 03:00, Kai Schlamp wrote:
> Hello.
> 
> In my application the analysis engine parameters can only be set 
> programmatically. This is normally done after the analysis engine is 
> produced. 
> After setting the parameters it is reconfigured. So far so good.
> The problem is now that one specific analysis engine throws an exception when 
> it 
> is produced as it contains by default some invalid parameters.
> Is there a way to specify the parameters of an analysis engine before it is 
> produced?
> 
> URL descriptorUrl = bundle.getResource(descriptorPath);
> XMLInputSource input = new XMLInputSource(descriptorUrl);
> ResourceSpecifier resourceSpecifier = 
> UIMAFramework.getXMLParser().parseResourceSpecifier(input);

You can modify the ResourceSpecifier, check the javadocs,
and possibly the source code.  You'll probably need to
cast the ResourceSpecifier to its actual type and go from
there.

--Thilo

> resourceSpecifier.AnalysisEngine analysisEngine = 
> UIMAFramework.produceAnalysisEngine(resourceSpecifier);
> --> here comes the ResourceInitializationException
> 
> Best regards,
> Kai

Reply via email to