public class EdgeNGramTokenizer extends Tokenizer
| Modifier and Type | Class and Description |
|---|---|
static class |
EdgeNGramTokenizer.Side
Specifies which side of the input the n-gram should be generated from
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_GRAM_SIZE |
static int |
DEFAULT_MIN_GRAM_SIZE |
static EdgeNGramTokenizer.Side |
DEFAULT_SIDE |
| Constructor and Description |
|---|
EdgeNGramTokenizer(java.io.Reader input,
EdgeNGramTokenizer.Side side,
int minGram,
int maxGram)
Creates EdgeNGramTokenizer that can generate n-grams in the sizes of the given range
|
EdgeNGramTokenizer(java.io.Reader input,
java.lang.String sideLabel,
int minGram,
int maxGram)
Creates EdgeNGramTokenizer that can generate n-grams in the sizes of the given range
|
public static final EdgeNGramTokenizer.Side DEFAULT_SIDE
public static final int DEFAULT_MAX_GRAM_SIZE
public static final int DEFAULT_MIN_GRAM_SIZE
public EdgeNGramTokenizer(java.io.Reader input,
EdgeNGramTokenizer.Side side,
int minGram,
int maxGram)
input - Reader holding the input to be tokenizedside - the EdgeNGramTokenizer.Side from which to chop off an n-gramminGram - the smallest n-gram to generatemaxGram - the largest n-gram to generatepublic EdgeNGramTokenizer(java.io.Reader input,
java.lang.String sideLabel,
int minGram,
int maxGram)
input - Reader holding the input to be tokenizedsideLabel - the name of the EdgeNGramTokenizer.Side from which to chop off an n-gramminGram - the smallest n-gram to generatemaxGram - the largest n-gram to generatepublic final Token next(Token reusableToken) throws java.io.IOException
next in class TokenStreamreusableToken - a Token that may or may not be used to
return; this parameter should never be null (the callee
is not required to check for null before using it, but it is a
good idea to assert that it is not null.)java.io.IOExceptionCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.