TestStopFilterpublic class TestStopFilter extends TestCase
Methods Summary |
---|
public void | testExactCase()
StringReader reader = new StringReader("Now is The Time");
String[] stopWords = new String[] { "is", "the", "Time" };
TokenStream stream = new StopFilter(new WhitespaceTokenizer(reader), stopWords);
assertEquals("Now", stream.next().termText());
assertEquals("The", stream.next().termText());
assertEquals(null, stream.next());
| public void | testIgnoreCase()
StringReader reader = new StringReader("Now is The Time");
String[] stopWords = new String[] { "is", "the", "Time" };
TokenStream stream = new StopFilter(new WhitespaceTokenizer(reader), stopWords, true);
assertEquals("Now", stream.next().termText());
assertEquals(null,stream.next());
|
|