public void process(JCas jcas) throws AnalysisEngineProcessException {
for (Annotation annotation : jcas.getAnnotationIndex(TokenAnnotation.type)) {
String tokenPOS = ((TokenAnnotation) annotation).getPosTag();
if ("jj".equals(tokenPOS)) {
if (Arrays.asList(positiveAdj).contains(annotation.getCoveredText())) {
SentimentAnnotation sentimentAnnotation = createSentimentAnnotation(jcas, annotation);
sentimentAnnotation.setMood("positive");
sentimentAnnotation.addToIndexes();
}
else if (Arrays.asList(negativeAdj).contains(annotation.getCoveredText())) {
SentimentAnnotation sentimentAnnotation = createSentimentAnnotation(jcas, annotation);
sentimentAnnotation.setMood("negative");
sentimentAnnotation.addToIndexes();
}
}
}
}