// 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];
//     }
// }


import com.caseystella.ds.nlp.SentimentClass;
import com.caseystella.ds.nlp.rollup.strategy.*;
import java.util.List;
package com.caseystella.ds.nlp.rollup;



/**
 * Created by cstella on 3/25/14.
 */
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
// 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/SentimentRollup.java
import com.caseystella.ds.nlp.SentimentClass;
import com.caseystella.ds.nlp.rollup.strategy.*;
import java.util.List;

package com.caseystella.ds.nlp.rollup;



/**
 * Created by cstella on 3/25/14.
 */
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) {