public class KeywordProcessor implements AlchemyOutputProcessor {
public void process(JCas cas, Results results) throws Exception {
for (Keyword k : ((KeywordResults) results).getKeywords()) {
try {
KeywordFS fs = new KeywordFS(cas);
Type type = fs.getType();
fs.setFeatureValueFromString(type.getFeatureByBaseName("text"), k.getText()); // text
fs.addToIndexes();
} catch (Exception e) {
throw new MappingException(e);
}
}
}