C# Class Lucene.Net.Analysis.Miscellaneous.LimitTokenPositionFilter

This TokenFilter limits its emitted tokens to those with positions that are not greater than the configured limit.

By default, this filter ignores any tokens in the wrapped {@code TokenStream} once the limit has been exceeded, which can result in {@code reset()} being called prior to {@code incrementToken()} returning {@code false}. For most {@code TokenStream} implementations this should be acceptable, and faster then consuming the full stream. If you are wrapping a {@code TokenStream} which requires that the full stream of tokens be exhausted in order to function properly, use the #LimitTokenPositionFilter(TokenStream,int,boolean) consumeAllTokens option.

Inheritance: TokenFilter
Datei anzeigen Open project: apache/lucenenet Class Usage Examples

Public Methods

Method Description
IncrementToken ( ) : bool
LimitTokenPositionFilter ( TokenStream @in, int maxTokenPosition ) : Lucene.Net.Analysis.Tokenattributes

Build a filter that only accepts tokens up to and including the given maximum position. This filter will not consume any tokens with position greater than the maxTokenPosition limit.

LimitTokenPositionFilter ( TokenStream @in, int maxTokenPosition, bool consumeAllTokens ) : Lucene.Net.Analysis.Tokenattributes

Build a filter that limits the maximum position of tokens to emit.

Reset ( ) : void

Method Details

IncrementToken() public method

public IncrementToken ( ) : bool
return bool

LimitTokenPositionFilter() public method

Build a filter that only accepts tokens up to and including the given maximum position. This filter will not consume any tokens with position greater than the maxTokenPosition limit.
public LimitTokenPositionFilter ( TokenStream @in, int maxTokenPosition ) : Lucene.Net.Analysis.Tokenattributes
@in TokenStream
maxTokenPosition int max position of tokens to produce (1st token always has position 1) ///
return Lucene.Net.Analysis.Tokenattributes

LimitTokenPositionFilter() public method

Build a filter that limits the maximum position of tokens to emit.
public LimitTokenPositionFilter ( TokenStream @in, int maxTokenPosition, bool consumeAllTokens ) : Lucene.Net.Analysis.Tokenattributes
@in TokenStream
maxTokenPosition int max position of tokens to produce (1st token always has position 1)
consumeAllTokens bool whether all tokens from the wrapped input stream must be consumed /// even if maxTokenPosition is exceeded.
return Lucene.Net.Analysis.Tokenattributes

Reset() public method

public Reset ( ) : void
return void