use of org.apache.uima.resource.impl.CustomResourceSpecifier_impl in project dkpro-tc by dkpro.
the class FeatureResourceLoader method configureOverrides.
private void configureOverrides(File tcModelLocation, ExternalResourceDescription exRes, Map<String, String> overrides) throws IOException {
// We assume for the moment that we only have primitive analysis engines
// for meta
// collection, not aggregates. If there were aggregates, we'd have to do
// this
// recursively
ResourceSpecifier aDesc = exRes.getResourceSpecifier();
if (aDesc instanceof AnalysisEngineDescription) {
// Analysis engines are ok
if (!((AnalysisEngineDescription) aDesc).isPrimitive()) {
throw new IllegalArgumentException("Only primitive meta collectors currently supported.");
}
} else if (aDesc instanceof CustomResourceSpecifier_impl) {
// Feature extractors are ok
} else {
throw new IllegalArgumentException("Descriptors of type " + aDesc.getClass() + " not supported.");
}
for (Entry<String, String> e : overrides.entrySet()) {
// We generate a storage location from the feature extractor
// discriminator value
// and the preferred value specified by the meta collector
String parameterName = e.getKey();
ConfigurationParameterFactory.setParameter(aDesc, parameterName, new File(tcModelLocation, e.getValue()).getAbsolutePath());
}
}
Aggregations