@Test
public void evaluateTextIndex(){

	FieldName name = FieldName.create("x");
	TextIndex textIndex = new TextIndex(name, new Constant("user friendly"))
		.setWordSeparatorCharacterRE("[\\s\\-]");
	assertEquals(null, evaluate(textIndex, name, null));
	assertEquals(1, evaluate(textIndex, name, "user friendly"));
	assertEquals(1, evaluate(textIndex, name, "user-friendly"));
	textIndex = new TextIndex(name, new Constant("brown fox"));
	String text = "The quick browny foxy jumps over the lazy dog. The brown fox runs away and to be with another brown foxy.";
	textIndex.setMaxLevenshteinDistance(0);
	assertEquals(1, evaluate(textIndex, name, text));
	textIndex.setMaxLevenshteinDistance(1);
	assertEquals(2, evaluate(textIndex, name, text));
	textIndex.setMaxLevenshteinDistance(2);
	assertEquals(3, evaluate(textIndex, name, text));
	textIndex = new TextIndex(name, new Constant("dog"))
		.setMaxLevenshteinDistance(1);
	text = "I have a doog. My dog is white. The doog is friendly.";
	textIndex.setCountHits(CountHits.ALL_HITS);
	assertEquals(3, evaluate(textIndex, name, text));
	textIndex.setCountHits(CountHits.BEST_HITS);
	assertEquals(1, evaluate(textIndex, name, text));
	textIndex = new TextIndex(name, new Constant("sun"))
		.setCaseSensitive(false);
	text = "The Sun was setting while the captain's son reached the bounty island, minutes after their ship had sunk to the bottom of the ocean.";
	textIndex.setMaxLevenshteinDistance(0);
	assertEquals(1, evaluate(textIndex, name, text));
	textIndex.setMaxLevenshteinDistance(1);
	assertEquals(3, evaluate(textIndex, name, text));
}