// Path: src/main/java/affective/core/SentiStrengthEvaluator.java
// public class SentiStrengthEvaluator extends LexiconEvaluator  {
// 
// 
// 	/** For serialization. */
// 	private static final long serialVersionUID = -2094228012480778199L;
// 	
// 	/** The SentiStrengh object. */
// 	protected transient SentiStrength sentiStrength;
// 	
// 
// 	/**
// 	 * initializes the Object
// 	 * 
// 	 * @param file the file with the lexicon
// 	 * @param name the prefix for all the attributes calculated from this lexicon
// 	 */	
// 	public SentiStrengthEvaluator(String file,String name) {
// 		super(file,name);
// 		
// 	
// 				
// 		this.featureNames=new ArrayList<String>();
// 		this.featureNames.add(name+"-posScore");
// 		this.featureNames.add(name+"-negScore");
// 
// 	}
// 
// 
// 	/* (non-Javadoc)
// 	 * @see affective.core.LexiconEvaluator#processDict()
// 	 */
// 	@Override
// 	public void processDict() throws IOException  {
// 		this.sentiStrength = new SentiStrength();
// 		String sentiParams[] = {"sentidata", this.path, "trinary"};
// 		this.sentiStrength.initialise(sentiParams);		
// 	}
// 
// 
// 
// 	/* (non-Javadoc)
// 	 * @see affective.core.LexiconEvaluator#evaluateTweet(java.util.List)
// 	 */
// 	@Override
// 	public Map<String, Double> evaluateTweet(List<String> tokens) {
// 	
// 		Map<String, Double> strengthScores = new HashMap<String, Double>();
// 		
// 		String sentence = "";
// 		for (int i = 0; i < tokens.size(); i++) {
// 			sentence += tokens.get(i);
// 			if (i < tokens.size() - 1) {
// 				sentence += "+";
// 			}
// 		}
// 		
// 		String result = sentiStrength.computeSentimentScores(sentence);
// 		
// 		String[] values = result.split(" ");
// 		strengthScores.put(name+"-posScore", Double.parseDouble(values[0]));
// 		strengthScores.put(name+"-negScore", Double.parseDouble(values[1]));
// 
// 		return strengthScores;
// 	}
// 	
// }


import weka.core.OptionMetadata;
import weka.core.SparseInstance;
import weka.core.TechnicalInformation;
import weka.core.WekaPackageManager;
import weka.core.TechnicalInformation.Type;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import affective.core.SentiStrengthEvaluator;
import weka.core.Attribute;
import weka.core.Instance;
import weka.core.Instances;
		att.add(new Attribute("SentiStrength-negScore"));

		Instances result = new Instances(inputFormat.relationName(), att, 0);

		// set the class index
		result.setClassIndex(inputFormat.classIndex());

		return result;
	}



	/* (non-Javadoc)
	 * @see weka.filters.SimpleFilter#process(weka.core.Instances)
	 */
	@Override
	protected Instances process(Instances instances) throws Exception {


		// set upper value for text index
		m_textIndex.setUpper(instances.numAttributes() - 1);

		Instances result = getOutputFormat();


		// reference to the content of the message, users index start from zero
		Attribute attrCont = instances.attribute(this.m_textIndex.getIndex());


		// SentiStrength is re-intialized in each batch as it is not serializable
// Path: src/main/java/affective/core/SentiStrengthEvaluator.java
// public class SentiStrengthEvaluator extends LexiconEvaluator  {
// 
// 
// 	/** For serialization. */
// 	private static final long serialVersionUID = -2094228012480778199L;
// 	
// 	/** The SentiStrengh object. */
// 	protected transient SentiStrength sentiStrength;
// 	
// 
// 	/**
// 	 * initializes the Object
// 	 * 
// 	 * @param file the file with the lexicon
// 	 * @param name the prefix for all the attributes calculated from this lexicon
// 	 */	
// 	public SentiStrengthEvaluator(String file,String name) {
// 		super(file,name);
// 		
// 	
// 				
// 		this.featureNames=new ArrayList<String>();
// 		this.featureNames.add(name+"-posScore");
// 		this.featureNames.add(name+"-negScore");
// 
// 	}
// 
// 
// 	/* (non-Javadoc)
// 	 * @see affective.core.LexiconEvaluator#processDict()
// 	 */
// 	@Override
// 	public void processDict() throws IOException  {
// 		this.sentiStrength = new SentiStrength();
// 		String sentiParams[] = {"sentidata", this.path, "trinary"};
// 		this.sentiStrength.initialise(sentiParams);		
// 	}
// 
// 
// 
// 	/* (non-Javadoc)
// 	 * @see affective.core.LexiconEvaluator#evaluateTweet(java.util.List)
// 	 */
// 	@Override
// 	public Map<String, Double> evaluateTweet(List<String> tokens) {
// 	
// 		Map<String, Double> strengthScores = new HashMap<String, Double>();
// 		
// 		String sentence = "";
// 		for (int i = 0; i < tokens.size(); i++) {
// 			sentence += tokens.get(i);
// 			if (i < tokens.size() - 1) {
// 				sentence += "+";
// 			}
// 		}
// 		
// 		String result = sentiStrength.computeSentimentScores(sentence);
// 		
// 		String[] values = result.split(" ");
// 		strengthScores.put(name+"-posScore", Double.parseDouble(values[0]));
// 		strengthScores.put(name+"-negScore", Double.parseDouble(values[1]));
// 
// 		return strengthScores;
// 	}
// 	
// }


// Path: src/main/java/weka/filters/unsupervised/attribute/TweetToSentiStrengthFeatureVector.java
import weka.core.OptionMetadata;
import weka.core.SparseInstance;
import weka.core.TechnicalInformation;
import weka.core.WekaPackageManager;
import weka.core.TechnicalInformation.Type;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import affective.core.SentiStrengthEvaluator;
import weka.core.Attribute;
import weka.core.Instance;
import weka.core.Instances;

		att.add(new Attribute("SentiStrength-negScore"));

		Instances result = new Instances(inputFormat.relationName(), att, 0);

		// set the class index
		result.setClassIndex(inputFormat.classIndex());

		return result;
	}



	/* (non-Javadoc)
	 * @see weka.filters.SimpleFilter#process(weka.core.Instances)
	 */
	@Override
	protected Instances process(Instances instances) throws Exception {


		// set upper value for text index
		m_textIndex.setUpper(instances.numAttributes() - 1);

		Instances result = getOutputFormat();


		// reference to the content of the message, users index start from zero
		Attribute attrCont = instances.attribute(this.m_textIndex.getIndex());


		// SentiStrength is re-intialized in each batch as it is not serializable
		SentiStrengthEvaluator sentiStrengthEvaluator=new SentiStrengthEvaluator(