Example usage for org.apache.lucene.analysis.core WhitespaceTokenizerFactory create

List of usage examples for org.apache.lucene.analysis.core WhitespaceTokenizerFactory create

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.core WhitespaceTokenizerFactory create.

Prototype

@Override
    public Tokenizer create(AttributeFactory factory) 

Source Link

Usage

From source file:org.apache.solr.analysis.TestStandardFactories.java

License:Apache License

/**
 * Test WhitespaceTokenizerFactory//from w w  w .  j a va 2s  .c o  m
 */
public void testWhitespaceTokenizer() throws Exception {
    Reader reader = new StringReader("What's this thing do?");
    WhitespaceTokenizerFactory factory = new WhitespaceTokenizerFactory();
    factory.init(DEFAULT_VERSION_PARAM);
    Tokenizer stream = factory.create(reader);
    assertTokenStreamContents(stream, new String[] { "What's", "this", "thing", "do?" });
}