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
Implements
Inherited Members
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
Methods
Accept()
Returns the next input Token whose Term is not a stop word.
Declaration
protected override bool Accept()
Returns
Type | Description |
---|---|
bool |
Overrides
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)
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<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 |