use of org.apache.uima.analysis_component.AnalysisComponent in project dkpro-tc by dkpro.
the class TcAnnotator method callConversionEngine.
private void callConversionEngine(JCas aJCas) throws AnalysisEngineProcessException {
String name = conversionAnnotator[0];
Object[] parameters = new String[0];
if (conversionAnnotator.length > 1) {
parameters = new String[conversionAnnotator.length - 1];
System.arraycopy(conversionAnnotator, 1, parameters, 0, conversionAnnotator.length - 1);
}
try {
@SuppressWarnings("unchecked") Class<? extends AnalysisComponent> forName = (Class<? extends AnalysisComponent>) Class.forName(name);
AnalysisEngine conversionEngine = AnalysisEngineFactory.createEngine(forName, parameters);
conversionEngine.process(aJCas);
} catch (Exception e) {
throw new AnalysisEngineProcessException(e);
}
for (TextClassificationOutcome o : JCasUtil.select(aJCas, TextClassificationOutcome.class)) {
o.removeFromIndexes();
}
}
Aggregations