org.apache.lucene.analysis.ngram
Class EdgeNGramTokenizer
java.lang.Object
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.Tokenizer
org.apache.lucene.analysis.ngram.EdgeNGramTokenizer
- public class EdgeNGramTokenizer
- extends Tokenizer
Tokenizes the input into n-grams of the given size.
- Author:
- Otis Gospodnetic
Nested Class Summary |
static class |
EdgeNGramTokenizer.Side
Specifies which side of the input the n-gram should be generated from |
Fields inherited from class org.apache.lucene.analysis.Tokenizer |
input |
Method Summary |
Token |
next()
Returns the next token in the stream, or null at EOS. |
Methods inherited from class org.apache.lucene.analysis.Tokenizer |
close |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EdgeNGramTokenizer
public EdgeNGramTokenizer(Reader input,
EdgeNGramTokenizer.Side side,
int gramSize)
- Creates EdgeNGramTokenizer that can generate an n-gram of the given size.
- Parameters:
input
- Reader holding the input to be tokenizedside
- the EdgeNGramTokenizer.Side
from which to chop off an n-gramgramSize
- the size of the n-gram to generate
EdgeNGramTokenizer
public EdgeNGramTokenizer(Reader input,
String side,
int gramSize)
next
public final Token next()
throws IOException
- Returns the next token in the stream, or null at EOS.
- Specified by:
next
in class TokenStream
- Throws:
IOException
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.