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

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

Introduction

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

Prototype

@Override
    public LetterTokenizer create(AttributeFactory factory) 

Source Link

Usage

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

License:Apache License

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