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

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

Introduction

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

Prototype

@Override
    public KeywordTokenizer create(AttributeFactory factory) 

Source Link

Usage

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

License:Apache License

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