public class CategorizationProcessor implements AlchemyOutputProcessor {
public void process(JCas cas, Results results) throws Exception {
try {
FeatureStructure fs = new Category(cas);
Type type = fs.getType();
fs.setFeatureValueFromString(type.getFeatureByBaseName("score"),
((CategorizationResults) results).getScore());
fs.setFeatureValueFromString(type.getFeatureByBaseName("text"),
((CategorizationResults) results).getCategory());
cas.addFsToIndexes(fs);
} catch (Exception e) {
e.printStackTrace();
throw new MappingException(e);