import org.apache.uima.jcas.JCas;
public class SentimentAnalysisProcessor implements AlchemyOutputProcessor {
public void process(JCas cas, Results results) throws Exception {
DocumentSentiment docSentiment = ((SentimentAnalysisResults) results).getDocSentiment();
if (docSentiment != null) {
SentimentFS sentimentFS = new SentimentFS(cas);
sentimentFS.setScore(docSentiment.getScore());
sentimentFS.setSentimentType(docSentiment.getType());
sentimentFS.addToIndexes();
}
}