Class LengthFilter
Removes words that are too long or too short from the stream.
Note: Length is calculated as the number of UTF-16 code units.
Implements
Inherited Members
TokenStream.Dispose()
AttributeSource.GetAttributeFactory()
AttributeSource.GetAttributeClassesEnumerator()
AttributeSource.GetAttributeImplsEnumerator()
AttributeSource.AddAttributeImpl(Attribute)
AttributeSource.AddAttribute<T>()
AttributeSource.HasAttributes
AttributeSource.HasAttribute<T>()
AttributeSource.GetAttribute<T>()
AttributeSource.ClearAttributes()
AttributeSource.CaptureState()
AttributeSource.RestoreState(AttributeSource.State)
AttributeSource.GetHashCode()
AttributeSource.ReflectWith(IAttributeReflector)
AttributeSource.CloneAttributes()
AttributeSource.CopyTo(AttributeSource)
AttributeSource.ToString()
Namespace: Lucene.Net.Analysis.Miscellaneous
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class LengthFilter : FilteringTokenFilter, IDisposable
Constructors
LengthFilter(LuceneVersion, TokenStream, int, int)
Create a new LengthFilter. This will filter out tokens whose Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute is either too short (Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Length < min) or too long (Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Length > max).
Declaration
public LengthFilter(LuceneVersion version, TokenStream @in, int min, int max)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | version | the Lucene match version |
TokenStream | in | the Lucene.Net.Analysis.TokenStream to consume |
int | min | the minimum length |
int | max | the maximum length |
LengthFilter(LuceneVersion, bool, TokenStream, int, int)
Removes words that are too long or too short from the stream.
Note: Length is calculated as the number of UTF-16 code units.
Declaration
[Obsolete("enablePositionIncrements=false is not supported anymore as of Lucene 4.4.")]
public LengthFilter(LuceneVersion version, bool enablePositionIncrements, TokenStream @in, int min, int max)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | version | |
bool | enablePositionIncrements | |
TokenStream | in | |
int | min | |
int | max |
Methods
Accept()
Override this method and return if the current input token should be returned by IncrementToken().
Declaration
protected override bool Accept()
Returns
Type | Description |
---|---|
bool |