Hello everybody,
I'd like to know how to create and set up feature paths and, precisely, I would
like
to know how to use the initialize method correctly.
In the following example, I both use the initialize and addfeature methods to
set up
feature paths:
private FeaturePath getFeaturePath(JCas cas,Feature feature) {
FeaturePath path = cas.createFeaturePath();
path.addFeature(feature);
return path;
}
private FeaturePath getFeaturePath(JCas cas,String feature) throws
CASException {
FeaturePath path = cas.createFeaturePath();
path.initialize(feature);
return path;
}
private FeaturePath getFeaturePath(JCas cas,Type type,String feat) {
Feature feature = type.getFeatureByBaseName(feat);
String alternative = type.getName() + ":" + feat;
try {
return this.getFeaturePath(cas,alternative);
} catch (CASException e) {
this.getContext().getLogger().log(Level.SEVERE,e.getMessage());
return this.getFeaturePath(cas,feature);
}
}
However, I get this error message while processing an Analysis Engine that calls
such methods:
"Invalid featurePath syntax for featurePath "uima.tcas.Annotation:begin".
"begin" is not allowed.
What am I doing wrong with the initialize method?
Thank in advance,
jérôme