Hi all,
I'm a new UIMA user. I'm developing a CPM able to process pdf documents. I
need to set some parameters for each analysis engine using the related
descriptor, and some other programmatically.
I'm not able to do this. In particular, I correctly set the parameters into
the AE descriptor, but when I write my code to set the parameters
programmatically I always obtain a NullPointerException.
In the following I post an example of the code I use:
public void initialize(UimaContext context) throws
ResourceInitializationException
{
// Get the parameter representing a regular expression
String regexp = (String) context.getConfigParameterValue("REG_EXP");
...
}
In the CPM class I write the following code
...
ResourceSpecifier aeSpecifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(
new XMLInputSource("myAnalysisEngineDescriptor.xml"));
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeSpecifier);
ae.getMetaData().getConfigurationParameterSettings().setParameterValue("REG_EXP",
"myRegExp");
If the REG_EXP parameter has been declared in the AE descriptor, then I'm
able to set its value, else I obtain the NullPointerException when the
annotator use the regexp variable.
Note that I used ae.reconfigure() method, too, without any result.
Is it possible to solve this problem?
Regards.
Gg.