org.apache.lucene.analysis.ngram

Class 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

Field Summary

Fields inherited from class org.apache.lucene.analysis.Tokenizer

input

Constructor Summary

EdgeNGramTokenizer(Reader input, String side, int gramSize)
EdgeNGramTokenizer(Reader input, EdgeNGramTokenizer.Side side, int gramSize)
Creates EdgeNGramTokenizer that can generate an n-gram of the given size.

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 org.apache.lucene.analysis.TokenStream

close, next

Constructor Details

EdgeNGramTokenizer

public EdgeNGramTokenizer(Reader input,
                          String side,
                          int gramSize)

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 tokenized
side - the EdgeNGramTokenizer.Side from which to chop off an n-gram
gramSize - the size of the n-gram to generate

Method Details

next

public final Token next()
            throws IOException
Returns the next token in the stream, or null at EOS.
Overrides:
next in interface TokenStream

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.