Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    AttributeSource
    TokenStream
    TokenFilter
    FilteringTokenFilter
    LengthFilter
    Implements
    IDisposable
    Inherited Members
    FilteringTokenFilter.IncrementToken()
    FilteringTokenFilter.Reset()
    FilteringTokenFilter.EnablePositionIncrements
    FilteringTokenFilter.SetEnablePositionIncrements(bool)
    FilteringTokenFilter.End()
    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.Equals(object)
    AttributeSource.ReflectAsString(bool)
    AttributeSource.ReflectWith(IAttributeReflector)
    AttributeSource.CloneAttributes()
    AttributeSource.CopyTo(AttributeSource)
    AttributeSource.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    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
    Overrides
    FilteringTokenFilter.Accept()

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.