// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/SentimentClass.java
// public enum SentimentClass {
//     VERY_NEGATIVE(0)
//    , NEGATIVE(1)
//    , NEUTRAL(2)
//    , POSITIVE(3)
//    , VERY_POSITIVE(4)
//     ;
//     private int index = -1;
//     SentimentClass(int idx)
//     {
//         index = idx;
//     }
//     public int getIndex() { return index;}
//     public static SentimentClass getSpecific(int sentimentClass)
//     {
//         return SentimentClass.values()[sentimentClass];
//     }
// 
//     public static SentimentClass getGeneral(int sentimentClass)
//     {
//         //remove the extreme cases
//         if(sentimentClass == 0) sentimentClass = 1;
//         if(sentimentClass == 4) sentimentClass = 3;
//         return SentimentClass.values()[sentimentClass];
//     }
// }
// 
// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/rollup/Sentence.java
// public class Sentence {
//     private EnumMap<SentimentClass, Double> sentimentProbabilities;
//     private String sentence;
//     private SentimentClass sentimentClass;
// 
//     public Sentence( double[] sentimentProbabilities
//                    , String sentence
//                    , SentimentClass sentimentClass
//                    )
//     {
//         this.sentence = sentence;
//         this.sentimentClass = sentimentClass;
//         this.sentimentProbabilities = new EnumMap<SentimentClass, Double>(SentimentClass.class);
//         for(int i = 0;i < sentimentProbabilities.length;++i)
//         {
//             this.sentimentProbabilities.put(SentimentClass.values()[i], sentimentProbabilities[i]);
//         }
//     }
// 
//     public String getSentence() { return sentence;}
//     public EnumMap<SentimentClass, Double> getSentimentProbabilities() { return sentimentProbabilities;}
//     public SentimentClass getSentiment() { return sentimentClass;}
// }
// 
// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/rollup/SentimentRollup.java
// public enum SentimentRollup implements ISentimentRollup {
//      SIMPLE_VOTE(new SimpleVoteRollup())
//     ,AVERAGE_PROBABILITIES(new AverageProbabilitiesRollup())
//     , LAST_SENTENCE_WINS(new LastSentenceWins())
//     , LONGEST_SENTENCE_WINS(new LongestSentenceWins())
//     , WILSON_SCORE(new WilsonScore())
//     ;
// 
//     private ISentimentRollup proxy;
//     SentimentRollup(ISentimentRollup proxy) { this.proxy = proxy;}
// 
//     @Override
//     public SentimentClass apply(List<Sentence> input) {
//         return proxy.apply(input);
//     }
// }


import com.caseystella.ds.nlp.SentimentClass;
import com.caseystella.ds.nlp.rollup.Sentence;
import com.caseystella.ds.nlp.rollup.SentimentRollup;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
package com.caseystella.ds.nlp.rollup.util;



/**
 * This is a utility that is intended to evaluate rollup approaches from some pre-processed data.
 */
public class EvaluateRollupApproaches
{
    private static class Document
    {
// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/SentimentClass.java
// public enum SentimentClass {
//     VERY_NEGATIVE(0)
//    , NEGATIVE(1)
//    , NEUTRAL(2)
//    , POSITIVE(3)
//    , VERY_POSITIVE(4)
//     ;
//     private int index = -1;
//     SentimentClass(int idx)
//     {
//         index = idx;
//     }
//     public int getIndex() { return index;}
//     public static SentimentClass getSpecific(int sentimentClass)
//     {
//         return SentimentClass.values()[sentimentClass];
//     }
// 
//     public static SentimentClass getGeneral(int sentimentClass)
//     {
//         //remove the extreme cases
//         if(sentimentClass == 0) sentimentClass = 1;
//         if(sentimentClass == 4) sentimentClass = 3;
//         return SentimentClass.values()[sentimentClass];
//     }
// }
// 
// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/rollup/Sentence.java
// public class Sentence {
//     private EnumMap<SentimentClass, Double> sentimentProbabilities;
//     private String sentence;
//     private SentimentClass sentimentClass;
// 
//     public Sentence( double[] sentimentProbabilities
//                    , String sentence
//                    , SentimentClass sentimentClass
//                    )
//     {
//         this.sentence = sentence;
//         this.sentimentClass = sentimentClass;
//         this.sentimentProbabilities = new EnumMap<SentimentClass, Double>(SentimentClass.class);
//         for(int i = 0;i < sentimentProbabilities.length;++i)
//         {
//             this.sentimentProbabilities.put(SentimentClass.values()[i], sentimentProbabilities[i]);
//         }
//     }
// 
//     public String getSentence() { return sentence;}
//     public EnumMap<SentimentClass, Double> getSentimentProbabilities() { return sentimentProbabilities;}
//     public SentimentClass getSentiment() { return sentimentClass;}
// }
// 
// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/rollup/SentimentRollup.java
// public enum SentimentRollup implements ISentimentRollup {
//      SIMPLE_VOTE(new SimpleVoteRollup())
//     ,AVERAGE_PROBABILITIES(new AverageProbabilitiesRollup())
//     , LAST_SENTENCE_WINS(new LastSentenceWins())
//     , LONGEST_SENTENCE_WINS(new LongestSentenceWins())
//     , WILSON_SCORE(new WilsonScore())
//     ;
// 
//     private ISentimentRollup proxy;
//     SentimentRollup(ISentimentRollup proxy) { this.proxy = proxy;}
// 
//     @Override
//     public SentimentClass apply(List<Sentence> input) {
//         return proxy.apply(input);
//     }
// }


// Path: Hadoop_Summit_Pig_for_Data_Science/src/main/java/com/caseystella/ds/nlp/rollup/util/EvaluateRollupApproaches.java
import com.caseystella.ds.nlp.SentimentClass;
import com.caseystella.ds.nlp.rollup.Sentence;
import com.caseystella.ds.nlp.rollup.SentimentRollup;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import java.io.*;
import java.util.ArrayList;
import java.util.List;

package com.caseystella.ds.nlp.rollup.util;



/**
 * This is a utility that is intended to evaluate rollup approaches from some pre-processed data.
 */
public class EvaluateRollupApproaches
{
    private static class Document
    {
        List<Sentence> sentences;