public class EdgeNGramTokenizer extends NGramTokenizer
This Tokenizer
create n-grams from the beginning edge or ending edge of a input token.
As of Lucene 4.4, this tokenizer
maxGram
larger than 1024 chars, but beware that this will result in increased memory usage
pre-tokenization
,
Although highly discouraged, it is still possible
to use the old behavior through Lucene43EdgeNGramTokenizer
.
AttributeSource.AttributeFactory, AttributeSource.State
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_GRAM_SIZE |
static int |
DEFAULT_MIN_GRAM_SIZE |
DEFAULT_MAX_NGRAM_SIZE, DEFAULT_MIN_NGRAM_SIZE
Constructor and Description |
---|
EdgeNGramTokenizer(Version version,
AttributeSource.AttributeFactory factory,
Reader input,
int minGram,
int maxGram)
Creates EdgeNGramTokenizer that can generate n-grams in the sizes of the given range
|
EdgeNGramTokenizer(Version version,
Reader input,
int minGram,
int maxGram)
Creates EdgeNGramTokenizer that can generate n-grams in the sizes of the given range
|
end, incrementToken, isTokenChar, reset
close, correctOffset, setReader
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
public static final int DEFAULT_MAX_GRAM_SIZE
public static final int DEFAULT_MIN_GRAM_SIZE
public EdgeNGramTokenizer(Version version, Reader input, int minGram, int maxGram)
version
- the Lucene match versioninput
- Reader
holding the input to be tokenizedminGram
- the smallest n-gram to generatemaxGram
- the largest n-gram to generatepublic EdgeNGramTokenizer(Version version, AttributeSource.AttributeFactory factory, Reader input, int minGram, int maxGram)
version
- the Lucene match versionfactory
- AttributeSource.AttributeFactory
to useinput
- Reader
holding the input to be tokenizedminGram
- the smallest n-gram to generatemaxGram
- the largest n-gram to generateCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.