FileDocCategorySizeDatePackage
TestStopFilter.javaAPI DocApache Lucene 1.91764Mon Feb 20 09:19:20 GMT 2006org.apache.lucene.analysis

TestStopFilter

public class TestStopFilter extends TestCase
author
yonik

Fields Summary
Constructors Summary
Methods Summary
public voidtestExactCase()

    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 voidtestIgnoreCase()

    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());