Show / Hide Table of Contents

    Class StopFilter

    Removes stop words from a token stream.

    You must specify the required 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
    System.Object
    AttributeSource
    TokenStream
    TokenFilter
    FilteringTokenFilter
    StopFilter
    Implements
    IDisposable
    Inherited Members
    FilteringTokenFilter.m_version
    FilteringTokenFilter.IncrementToken()
    FilteringTokenFilter.Reset()
    FilteringTokenFilter.EnablePositionIncrements
    FilteringTokenFilter.SetEnablePositionIncrements(Boolean)
    FilteringTokenFilter.End()
    TokenFilter.m_input
    TokenFilter.Dispose(Boolean)
    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(Boolean)
    AttributeSource.ReflectWith(IAttributeReflector)
    AttributeSource.CloneAttributes()
    AttributeSource.CopyTo(AttributeSource)
    AttributeSource.ToString()
    Namespace: Lucene.Net.Analysis.Core
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public sealed class StopFilter : FilteringTokenFilter, IDisposable

    Constructors

    | Improve this Doc View Source

    StopFilter(LuceneVersion, TokenStream, CharArraySet)

    Constructs a filter which removes words from the input 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 LuceneVersion> for details.

    TokenStream in

    Input TokenStream

    CharArraySet stopWords

    A CharArraySet representing the stopwords.

    See Also
    MakeStopSet(LuceneVersion, String[])

    Methods

    | Improve this Doc View Source

    Accept()

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

    Declaration
    protected override bool Accept()
    Returns
    Type Description
    System.Boolean
    Overrides
    FilteringTokenFilter.Accept()
    | Improve this Doc View Source

    MakeStopSet(LuceneVersion, 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 Analyzer is constructed.

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

    LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    System.String[] stopWords

    An array of stopwords

    Returns
    Type Description
    CharArraySet
    See Also
    MakeStopSet(LuceneVersion, String[], Boolean)
    | Improve this Doc View Source

    MakeStopSet(LuceneVersion, String[], Boolean)

    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

    LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    System.String[] stopWords

    An array of stopwords

    System.Boolean ignoreCase

    If true, all words are lower cased first.

    Returns
    Type Description
    CharArraySet

    a Set (CharArraySet) containing the words

    | Improve this Doc View Source

    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 Analyzer is constructed.

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

    LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    IList<T1> stopWords

    A List of s 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[], Boolean)
    | Improve this Doc View Source

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

    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

    LuceneVersion to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0

    IList<T1> stopWords

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

    System.Boolean 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
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)