org.apache.lucene.analysis.ngram
Class EdgeNGramTokenizer

java.lang.Object
  extended byorg.apache.lucene.analysis.TokenStream
      extended byorg.apache.lucene.analysis.Tokenizer
          extended byorg.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
 
Field Summary
 
Fields inherited from class org.apache.lucene.analysis.Tokenizer
input
 
Constructor Summary
EdgeNGramTokenizer(Reader input, EdgeNGramTokenizer.Side side, int gramSize)
          Creates EdgeNGramTokenizer that can generate an n-gram of the given size.
EdgeNGramTokenizer(Reader input, String side, int gramSize)
           
 
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
 

Constructor Detail

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

EdgeNGramTokenizer

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

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.