C# Class Lucene.Net.Analysis.StopFilter

Removes stop words from a token stream.
Inheritance: Lucene.Net.Analysis.TokenFilter
ファイルを表示 Open project: synhershko/lucene.net Class Usage Examples

Public Methods

Method Description
GetEnablePositionIncrementsVersionDefault ( Lucene.Net.Util.Version matchVersion ) : bool

Returns version-dependent default for enablePositionIncrements. Analyzers that embed StopFilter use this method when creating the StopFilter. Prior to 2.9, this returns false. On 2.9 or later, it returns true.

IncrementToken ( ) : bool

Returns the next input Token whose term() is not a stop word.

MakeStopSet ( ) : ISet

Builds a Set 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.

MakeStopSet ( IList stopWords ) : ISet

Builds a Set 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.

MakeStopSet ( IList stopWords, bool ignoreCase ) : ISet

MakeStopSet ( string stopWords, bool ignoreCase ) : ISet

StopFilter ( bool enablePositionIncrements, TokenStream @in, ISet stopWords ) : System

Constructs a filter which removes words from the input TokenStream that are named in the Set.

StopFilter ( bool enablePositionIncrements, TokenStream input, ISet stopWords, bool ignoreCase ) : System

Construct a token stream filtering the given input. If stopWords is an instance of CharArraySet (true if makeStopSet() was used to construct the set) it will be directly used and ignoreCase will be ignored since CharArraySet directly controls case sensitivity.

If stopWords is not an instance of CharArraySet, a new CharArraySet will be constructed and ignoreCase will be used to specify the case sensitivity of that set.

Method Details

GetEnablePositionIncrementsVersionDefault() public static method

Returns version-dependent default for enablePositionIncrements. Analyzers that embed StopFilter use this method when creating the StopFilter. Prior to 2.9, this returns false. On 2.9 or later, it returns true.
public static GetEnablePositionIncrementsVersionDefault ( Lucene.Net.Util.Version matchVersion ) : bool
matchVersion Lucene.Net.Util.Version
return bool

IncrementToken() public method

Returns the next input Token whose term() is not a stop word.
public IncrementToken ( ) : bool
return bool

MakeStopSet() public static method

Builds a Set 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.
public static MakeStopSet ( ) : ISet
return ISet

MakeStopSet() public static method

Builds a Set 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.
public static MakeStopSet ( IList stopWords ) : ISet
stopWords IList A list of strings or char[] or any other ToString()-able list representing the stop words
return ISet

MakeStopSet() public static method

public static MakeStopSet ( IList stopWords, bool ignoreCase ) : ISet
stopWords IList A List of Strings or char[] or any other toString()-able list representing the stopwords
ignoreCase bool if true, all words are lower cased first
return ISet

MakeStopSet() public static method

public static MakeStopSet ( string stopWords, bool ignoreCase ) : ISet
stopWords string An array of stopwords
ignoreCase bool If true, all words are lower cased first.
return ISet

StopFilter() public method

Constructs a filter which removes words from the input TokenStream that are named in the Set.
public StopFilter ( bool enablePositionIncrements, TokenStream @in, ISet stopWords ) : System
enablePositionIncrements bool true if token positions should record the removed stop words
@in TokenStream
stopWords ISet A Set of strings or char[] or any other ToString()-able set representing the stopwords
return System

StopFilter() public method

Construct a token stream filtering the given input. If stopWords is an instance of CharArraySet (true if makeStopSet() was used to construct the set) it will be directly used and ignoreCase will be ignored since CharArraySet directly controls case sensitivity.

If stopWords is not an instance of CharArraySet, a new CharArraySet will be constructed and ignoreCase will be used to specify the case sensitivity of that set.

public StopFilter ( bool enablePositionIncrements, TokenStream input, ISet stopWords, bool ignoreCase ) : System
enablePositionIncrements bool true if token positions should record the removed stop words
input TokenStream Input TokenStream
stopWords ISet A Set of strings or strings or char[] or any other ToString()-able set representing the stopwords
ignoreCase bool if true, all words are lower cased first
return System