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
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Core
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class StopFilter : FilteringTokenFilter, IDisposable
Constructors
| Improve this Doc View SourceStopFilter(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
Methods
| Improve this Doc View SourceAccept()
Returns the next input Token whose Term is not a stop word.
Declaration
protected override bool Accept()
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceMakeStopSet(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
| Improve this Doc View SourceMakeStopSet(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 |
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 |
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
| Improve this Doc View SourceMakeStopSet<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 |
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 |