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
    System.Object
    Lucene.Net.Util.AttributeSource
    Lucene.Net.Analysis.TokenStream
    Lucene.Net.Analysis.TokenFilter
    FilteringTokenFilter
    StopFilter
    Implements
    System.IDisposable
    Inherited Members
    FilteringTokenFilter.m_version
    FilteringTokenFilter.IncrementToken()
    FilteringTokenFilter.Reset()
    FilteringTokenFilter.EnablePositionIncrements
    FilteringTokenFilter.SetEnablePositionIncrements(Boolean)
    FilteringTokenFilter.End()
    Lucene.Net.Analysis.TokenFilter.m_input
    TokenFilter.Dispose(Boolean)
    Lucene.Net.Analysis.TokenStream.Dispose()
    Lucene.Net.Util.AttributeSource.GetAttributeFactory()
    Lucene.Net.Util.AttributeSource.GetAttributeClassesEnumerator()
    Lucene.Net.Util.AttributeSource.GetAttributeImplsEnumerator()
    Lucene.Net.Util.AttributeSource.AddAttributeImpl(Lucene.Net.Util.Attribute)
    Lucene.Net.Util.AttributeSource.AddAttribute<T>()
    Lucene.Net.Util.AttributeSource.HasAttributes
    Lucene.Net.Util.AttributeSource.HasAttribute<T>()
    Lucene.Net.Util.AttributeSource.GetAttribute<T>()
    Lucene.Net.Util.AttributeSource.ClearAttributes()
    Lucene.Net.Util.AttributeSource.CaptureState()
    Lucene.Net.Util.AttributeSource.RestoreState(Lucene.Net.Util.AttributeSource.State)
    Lucene.Net.Util.AttributeSource.GetHashCode()
    AttributeSource.Equals(Object)
    AttributeSource.ReflectAsString(Boolean)
    Lucene.Net.Util.AttributeSource.ReflectWith(Lucene.Net.Util.IAttributeReflector)
    Lucene.Net.Util.AttributeSource.CloneAttributes()
    Lucene.Net.Util.AttributeSource.CopyTo(Lucene.Net.Util.AttributeSource)
    Lucene.Net.Util.AttributeSource.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    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 Lucene.Net.Analysis.TokenStream that are named in the CharArraySet.

    Declaration
    public StopFilter(LuceneVersion matchVersion, TokenStream in, CharArraySet stopWords)
    Parameters
    Type Name Description
    Lucene.Net.Util.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.

    Lucene.Net.Analysis.TokenStream in

    Input Lucene.Net.Analysis.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 Lucene.Net.Analysis.Analyzer is constructed.

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

    Lucene.Net.Util.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
    Lucene.Net.Util.LuceneVersion matchVersion

    Lucene.Net.Util.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 Lucene.Net.Analysis.Analyzer is constructed.

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

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

    System.Collections.Generic.IList<T1> stopWords

    A List of System.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[], 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
    Lucene.Net.Util.LuceneVersion matchVersion

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

    System.Collections.Generic.IList<T1> stopWords

    A List of System.Strings 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

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 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.