Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class StopFilter

    Removes stop words from a token stream.

    You must specify the required Lucene.Net.Util.LuceneVersion compatibility when creating StopFilter:

    • As of 3.1, StopFilter correctly handles Unicode 4.0 supplementary characters in stopwords and position increments are preserved
    Inheritance
    object
    AttributeSource
    TokenStream
    TokenFilter
    FilteringTokenFilter
    StopFilter
    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.Core
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public sealed class StopFilter : FilteringTokenFilter, IDisposable

    Constructors

    StopFilter(LuceneVersion, TokenStream, CharArraySet)

    Constructs a filter which removes words from the input Lucene.Net.Analysis.TokenStream that are named in the CharArraySet.

    Declaration
    public StopFilter(LuceneVersion matchVersion, TokenStream @in, CharArraySet stopWords)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    Lucene version to enable correct Unicode 4.0 behavior in the stop set if Version > 3.0. See Lucene.Net.Util.LuceneVersion> for details.

    TokenStream in

    Input Lucene.Net.Analysis.TokenStream

    CharArraySet stopWords

    A CharArraySet representing the stopwords.

    See Also
    MakeStopSet(LuceneVersion, params string[])

    Methods

    Accept()

    Returns the next input Token whose Term is not a stop word.

    Declaration
    protected override bool Accept()
    Returns
    Type Description
    bool
    Overrides
    FilteringTokenFilter.Accept()

    MakeStopSet(LuceneVersion, IList<string>, bool)

    Creates a stopword set from the given stopword list.

    Declaration
    public static CharArraySet MakeStopSet(LuceneVersion matchVersion, IList<string> stopWords, bool ignoreCase)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    Lucene.Net.Util.LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    IList<string> stopWords

    A List of strings or char[] or any other ToString()-able list representing the stopwords

    bool ignoreCase

    if true, all words are lower cased first

    Returns
    Type Description
    CharArraySet

    A Set (CharArraySet) containing the words

    MakeStopSet(LuceneVersion, params string[])

    Builds a CharArraySet from an array of stop words, appropriate for passing into the StopFilter constructor. This permits this stopWords construction to be cached once when an Lucene.Net.Analysis.Analyzer is constructed.

    Declaration
    public static CharArraySet MakeStopSet(LuceneVersion matchVersion, params string[] stopWords)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    Lucene.Net.Util.LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    string[] stopWords

    An array of stopwords

    Returns
    Type Description
    CharArraySet
    See Also
    MakeStopSet(LuceneVersion, string[], bool)

    MakeStopSet(LuceneVersion, string[], bool)

    Creates a stopword set from the given stopword array.

    Declaration
    public static CharArraySet MakeStopSet(LuceneVersion matchVersion, string[] stopWords, bool ignoreCase)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    Lucene.Net.Util.LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    string[] stopWords

    An array of stopwords

    bool ignoreCase

    If true, all words are lower cased first.

    Returns
    Type Description
    CharArraySet

    a Set (CharArraySet) containing the words

    MakeStopSet<T1>(LuceneVersion, IList<T1>)

    Builds a CharArraySet from an array of stop words, appropriate for passing into the StopFilter constructor. This permits this stopWords construction to be cached once when an Lucene.Net.Analysis.Analyzer is constructed.

    Declaration
    public static CharArraySet MakeStopSet<T1>(LuceneVersion matchVersion, IList<T1> stopWords)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    Lucene.Net.Util.LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    IList<T1> stopWords

    A List of strings or char[] or any other ToString()-able list representing the stopwords

    Returns
    Type Description
    CharArraySet

    A Set (CharArraySet) containing the words

    Type Parameters
    Name Description
    T1
    See Also
    MakeStopSet(LuceneVersion, string[], bool)

    MakeStopSet<T1>(LuceneVersion, IList<T1>, bool)

    Creates a stopword set from the given stopword list.

    Declaration
    public static CharArraySet MakeStopSet<T1>(LuceneVersion matchVersion, IList<T1> stopWords, bool ignoreCase)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    Lucene.Net.Util.LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    IList<T1> stopWords

    A List of strings or char[] or any other ToString()-able list representing the stopwords

    bool ignoreCase

    if true, all words are lower cased first

    Returns
    Type Description
    CharArraySet

    A Set (CharArraySet) containing the words

    Type Parameters
    Name Description
    T1

    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.