Java org.apache.lucene.analysis.shingle ShingleFilter fields, constructors, methods, implement or subclass

Example usage for Java org.apache.lucene.analysis.shingle ShingleFilter fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.lucene.analysis.shingle ShingleFilter.

The text is from its open source code.

Field

StringDEFAULT_FILLER_TOKEN
filler token for when positionIncrement is more than 1
intDEFAULT_MAX_SHINGLE_SIZE
default maximum shingle size is 2.
intDEFAULT_MIN_SHINGLE_SIZE
default minimum shingle size is 2.
StringDEFAULT_TOKEN_TYPE
default token type attribute value is "shingle"
StringDEFAULT_TOKEN_SEPARATOR
The default string to use when joining adjacent tokens to form a shingle

Constructor

ShingleFilter(TokenStream input, int minShingleSize, int maxShingleSize)
Constructs a ShingleFilter with the specified shingle size from the TokenStream input
ShingleFilter(TokenStream input, int maxShingleSize)
Constructs a ShingleFilter with the specified shingle size from the TokenStream input
ShingleFilter(TokenStream input, String tokenType)
Construct a ShingleFilter with the specified token type for shingle tokens and the default shingle size: 2
ShingleFilter(TokenStream input)
Construct a ShingleFilter with default shingle size: 2.

Method

voidclose()

NOTE: The default implementation chains the call to the input TokenStream, so be sure to call super.close() when overriding this method.

voidend()
booleanincrementToken()
voidreset()
voidsetFillerToken(String fillerToken)
Sets the string to insert for each position at which there is no token (i.e., when position increment is greater than one).
voidsetMaxShingleSize(int maxShingleSize)
Set the max shingle size (default: 2)
voidsetOutputUnigrams(boolean outputUnigrams)
Shall the output stream contain the input tokens (unigrams) as well as shingles?
voidsetOutputUnigramsIfNoShingles(boolean outputUnigramsIfNoShingles)

Shall we override the behavior of outputUnigrams==false for those times when no shingles are available (because there are fewer than minShingleSize tokens in the input stream)?

voidsetTokenSeparator(String tokenSeparator)
Sets the string to use when joining adjacent tokens to form a shingle