// Path: src/main/java/cz/brmlab/brmson/core/provider/snowball/SnowballStemmerWrapper.java
// public final class SnowballStemmerWrapper extends SnowballStemmer {
// 
// 	private static boolean initialized = false;
// 
// 	public static void initialize() {
// 		if (initialized)
// 			return;
// 
// 		create();
// 
// 		initialized = true;
// 	}
// }
// 
// Path: src/main/java/cz/brmlab/brmson/blanqa/framework/data/Sentence.java
// public class Sentence {
// 	private String text;
// 	private Sentence prev, next;
// 
// 	private SearchResult resultRef;
// 
// 	private float score;
// 
// 	public Sentence(SearchResult resultRef, String text) {
// 		this.resultRef = resultRef;
// 		this.text = text;
// 		this.score = 0;
// 	}
// 
// 	public String getText() {
// 		return text;
// 	}
// 	public SearchResult getResultRef() {
// 		return resultRef;
// 	}
// 
// 	public Sentence getPrev() {
// 		return prev;
// 	}
// 	public void setPrev(Sentence s) {
// 		this.prev = s;
// 	}
// 
// 	public Sentence getNext() {
// 		return next;
// 	}
// 	public void setNext(Sentence s) {
// 		this.next = s;
// 	}
// 
// 	public float getScore() {
// 		return score;
// 	}
// 	public void setScore(float score) {
// 		this.score = score;
// 	}
// 	public void addScore(float score) {
// 		this.score += score;
// 	}
// }
// 
// Path: src/main/java/cz/brmlab/brmson/takepig/framework/data/AnswerSupport.java
// public class AnswerSupport {
// 
// 	private String questionText;
// 	private String answerType;
// 
// 	private List<String> keywords;
// 	private List<String> keyphrases;
// 
// 	private List<SearchResult> results;
// 
// 	public AnswerSupport(String questionText, String answerType,
// 			List<String> keywords, List<String> keyphrases,
// 			List<SearchResult> results) {
// 		this.questionText = questionText;
// 		this.answerType = answerType;
// 
// 		this.keywords = keywords;
// 		this.keyphrases = keyphrases;
// 
// 		this.results = results;
// 	}
// 
// 	public String getQuestionText() {
// 		return questionText;
// 	}
// 	public void setQuestionText(String questionText) {
// 		this.questionText = questionText;
// 	}
// 
// 	public String getAnswerType() {
// 		return answerType;
// 	}
// 	public void setAnswerType(String answerType) {
// 		this.answerType = answerType;
// 	}
// 
// 	public List<String> getKeywords() {
// 		return keywords;
// 	}
// 	public void setKeywords(List<String> keywords) {
// 		this.keywords = keywords;
// 	}
// 
// 	public List<String> getKeyphrases() {
// 		return keyphrases;
// 	}
// 	public void setKeyphrases(List<String> keyphrases) {
// 		this.keyphrases = keyphrases;
// 	}
// 
// 	public List<SearchResult> getResults() {
// 		return results;
// 	}
// }


import java.util.List;
import cz.brmlab.brmson.core.provider.snowball.SnowballStemmerWrapper;
import cz.brmlab.brmson.blanqa.framework.data.Sentence;
import cz.brmlab.brmson.takepig.framework.data.AnswerSupport;
package cz.brmlab.brmson.blanqa.analysis.scoring;



/**
 * Score a set of sentences based on keywords present in them or their neighbors.
 */

public class SentenceSimilarityUnigram implements ISentenceScorer {
	protected static final float CURRENT_SCORE = 3;
	protected static final float NEIGHBOR_SCORE = 1;

	protected AnswerSupport as;
	protected float CURRENT_SCORE_NORM, NEIGHBOR_SCORE_NORM;

	public SentenceSimilarityUnigram(AnswerSupport as) {
		this.as = as;

		List<String> keywords = as.getKeywords();
		CURRENT_SCORE_NORM = CURRENT_SCORE / keywords.size();
		NEIGHBOR_SCORE_NORM = NEIGHBOR_SCORE / keywords.size();
	}

	public void assignScore(Sentence s) {
// Path: src/main/java/cz/brmlab/brmson/core/provider/snowball/SnowballStemmerWrapper.java
// public final class SnowballStemmerWrapper extends SnowballStemmer {
// 
// 	private static boolean initialized = false;
// 
// 	public static void initialize() {
// 		if (initialized)
// 			return;
// 
// 		create();
// 
// 		initialized = true;
// 	}
// }
// 
// Path: src/main/java/cz/brmlab/brmson/blanqa/framework/data/Sentence.java
// public class Sentence {
// 	private String text;
// 	private Sentence prev, next;
// 
// 	private SearchResult resultRef;
// 
// 	private float score;
// 
// 	public Sentence(SearchResult resultRef, String text) {
// 		this.resultRef = resultRef;
// 		this.text = text;
// 		this.score = 0;
// 	}
// 
// 	public String getText() {
// 		return text;
// 	}
// 	public SearchResult getResultRef() {
// 		return resultRef;
// 	}
// 
// 	public Sentence getPrev() {
// 		return prev;
// 	}
// 	public void setPrev(Sentence s) {
// 		this.prev = s;
// 	}
// 
// 	public Sentence getNext() {
// 		return next;
// 	}
// 	public void setNext(Sentence s) {
// 		this.next = s;
// 	}
// 
// 	public float getScore() {
// 		return score;
// 	}
// 	public void setScore(float score) {
// 		this.score = score;
// 	}
// 	public void addScore(float score) {
// 		this.score += score;
// 	}
// }
// 
// Path: src/main/java/cz/brmlab/brmson/takepig/framework/data/AnswerSupport.java
// public class AnswerSupport {
// 
// 	private String questionText;
// 	private String answerType;
// 
// 	private List<String> keywords;
// 	private List<String> keyphrases;
// 
// 	private List<SearchResult> results;
// 
// 	public AnswerSupport(String questionText, String answerType,
// 			List<String> keywords, List<String> keyphrases,
// 			List<SearchResult> results) {
// 		this.questionText = questionText;
// 		this.answerType = answerType;
// 
// 		this.keywords = keywords;
// 		this.keyphrases = keyphrases;
// 
// 		this.results = results;
// 	}
// 
// 	public String getQuestionText() {
// 		return questionText;
// 	}
// 	public void setQuestionText(String questionText) {
// 		this.questionText = questionText;
// 	}
// 
// 	public String getAnswerType() {
// 		return answerType;
// 	}
// 	public void setAnswerType(String answerType) {
// 		this.answerType = answerType;
// 	}
// 
// 	public List<String> getKeywords() {
// 		return keywords;
// 	}
// 	public void setKeywords(List<String> keywords) {
// 		this.keywords = keywords;
// 	}
// 
// 	public List<String> getKeyphrases() {
// 		return keyphrases;
// 	}
// 	public void setKeyphrases(List<String> keyphrases) {
// 		this.keyphrases = keyphrases;
// 	}
// 
// 	public List<SearchResult> getResults() {
// 		return results;
// 	}
// }


// Path: src/main/java/cz/brmlab/brmson/blanqa/analysis/scoring/SentenceSimilarityUnigram.java
import java.util.List;
import cz.brmlab.brmson.core.provider.snowball.SnowballStemmerWrapper;
import cz.brmlab.brmson.blanqa.framework.data.Sentence;
import cz.brmlab.brmson.takepig.framework.data.AnswerSupport;

package cz.brmlab.brmson.blanqa.analysis.scoring;



/**
 * Score a set of sentences based on keywords present in them or their neighbors.
 */

public class SentenceSimilarityUnigram implements ISentenceScorer {
	protected static final float CURRENT_SCORE = 3;
	protected static final float NEIGHBOR_SCORE = 1;

	protected AnswerSupport as;
	protected float CURRENT_SCORE_NORM, NEIGHBOR_SCORE_NORM;

	public SentenceSimilarityUnigram(AnswerSupport as) {
		this.as = as;

		List<String> keywords = as.getKeywords();
		CURRENT_SCORE_NORM = CURRENT_SCORE / keywords.size();
		NEIGHBOR_SCORE_NORM = NEIGHBOR_SCORE / keywords.size();
	}

	public void assignScore(Sentence s) {
                String currentSentence = SnowballStemmerWrapper.stemAllTokens(s.getText().toLowerCase());