11051106110711081109111011111112111311141115
} } } }; helper.start(); } public void testMaxSizeHighlight() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
11281129113011311132113311341135113611371138
+ "us from finding matches for this record: " + numHighlights + " found", numHighlights == 0); } }; helper.start(); } public void testMaxSizeHighlightTruncates() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
11741175117611771178117911801181118211831184
assertTrue("Matched text should be no more than 100 chars in length ", match.length() < hg .getMaxDocCharsToAnalyze()); } }; helper.start(); } public void testMaxSizeEndHighlight() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
11991200120112021203120412051206120712081209
assertTrue( "Matched text should contain remainder of text after highlighted query ", match.endsWith("in it")); } }; helper.start(); } public void testUnRewrittenQuery() throws Exception { final TestHighlightRunner helper = new TestHighlightRunner() {
12471248124912501251125212531254125512561257
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 0); } }; helper.start(); } public void testNoFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
12681269127012711272127312741275127612771278
assertNull("The highlight result should be null for text with no query terms", result); } } }; helper.start(); } /** * Demonstrates creation of an XHTML compliant doc using new encoding facilities. *
14161417141814191420142114221423142414251426
reader.close(); } }; helper.start(); } protected TokenStream getTS2() { // String s = "Hi-Speed10 foo";
15911592159315941595159615971598159916001601
result = highlighter.getBestFragments(getTS2a(), s, 3, "..."); assertEquals("<B>Hi-Speed</B>10 foo", result); } }; helper.start(); } private Directory dir = new RAMDirectory(); private Analyzer a = new WhitespaceAnalyzer();
484485486487488489490491492493494
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 4); } }; helper.start(); } public void testGetFuzzyFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
499500501502503504505506507508509
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 5); } }; helper.start(); } public void testGetWildCardFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {