Map<String,Double> resultsMap = new HashMap<String,Double>();
Map<String,Integer> countsMap = new HashMap<String,Integer>();
for(SimpleTweet tweet : tweets) {
CalaisClassification classification = CalaisClassifier.classifyText(tweet.getText());
if(classification == null) {
//Normally this is because of a <100 char tweet
continue;
}
for(String category : classification.getCategories()) {
double score = classification.lookupScore(category);
if(resultsMap.containsKey(category)) {
resultsMap.put(category, resultsMap.get(category) + score);
countsMap.put(category, countsMap.get(category) + 1);
} else {
resultsMap.put(category, score);