public Pair<List<Sentence>, Double> getBestSnippet(ScoreFunction func, int minLength, int maxLength, int delta, int windowSize) {
		double highscore = Double.MIN_VALUE;
		List<Sentence> bestSentences = null;
		
		for (Pair<Integer, Integer> boundaries : chooseTwo(sentences.size())) {
			int start = boundaries.first();
			int end = boundaries.second();			
			if ((end - start) > maxLength || (end - start) < minLength ) continue;
			List<Sentence> currentSentences = sentences.subList(start, end);			
			int currentLength = 0;
			boolean seen = false;
			for (Sentence sentence : currentSentences){
				currentLength += sentence.terms.size();
				seen |= sentence.isSeen();
			}
			if (seen) continue;
			if (currentLength > windowSize) continue;
			//Set<String> uniqueTerms = new HashSet<String>();
			List<String> uniqueTerms = new ArrayList<String>();
			for (Sentence sentence : currentSentences){
				uniqueTerms.addAll(sentence.terms);	
			}
			double score = func.getScore(uniqueTerms, this.index) / (currentLength + delta);
			if (score > highscore) {
				highscore = score;			
				
				bestSentences = currentSentences;
			}
		}
		return new Pair<List<Sentence>, Double>(bestSentences, highscore);
	}