Class StopwordAnalyzerBase
Base class for Lucene.Net.Analysis.Analyzers that need to make use of stopword sets.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public abstract class StopwordAnalyzerBase : Analyzer, IDisposable
Constructors
StopwordAnalyzerBase(LuceneVersion)
Creates a new Lucene.Net.Analysis.Analyzer with an empty stopword set
Declaration
protected StopwordAnalyzerBase(LuceneVersion version)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | version | the Lucene version for cross version compatibility |
StopwordAnalyzerBase(LuceneVersion, CharArraySet)
Creates a new instance initialized with the given stopword set
Declaration
protected StopwordAnalyzerBase(LuceneVersion version, CharArraySet stopwords)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | version | the Lucene version for cross version compatibility |
CharArraySet | stopwords | the analyzer's stopword set |
Fields
m_matchVersion
Base class for Lucene.Net.Analysis.Analyzers that need to make use of stopword sets.
Declaration
protected readonly LuceneVersion m_matchVersion
Field Value
Type | Description |
---|---|
LuceneVersion |
m_stopwords
An immutable stopword set
Declaration
protected readonly CharArraySet m_stopwords
Field Value
Type | Description |
---|---|
CharArraySet |
Properties
StopwordSet
Returns the analyzer's stopword set or an empty set if the analyzer has no stopwords
Declaration
public virtual CharArraySet StopwordSet { get; }
Property Value
Type | Description |
---|---|
CharArraySet | the analyzer's stopword set or an empty set if the analyzer has no stopwords |
Methods
LoadStopwordSet(bool, Type, string, string)
Creates a CharArraySet from an embedded resource associated with a class. (See GetManifestResourceStream(string)).
Declaration
protected static CharArraySet LoadStopwordSet(bool ignoreCase, Type aClass, string resource, string comment)
Parameters
Type | Name | Description |
---|---|---|
bool | ignoreCase |
|
Type | aClass | a class that is associated with the given stopwordResource |
string | resource | name of the resource file associated with the given class |
string | comment | comment string to ignore in the stopword file |
Returns
Type | Description |
---|---|
CharArraySet | a CharArraySet containing the distinct stopwords from the given file |
Exceptions
Type | Condition |
---|---|
IOException | if loading the stopwords throws an IOException |
LoadStopwordSet(FileInfo, LuceneVersion)
Creates a CharArraySet from a file.
Declaration
protected static CharArraySet LoadStopwordSet(FileInfo stopwords, LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | stopwords | the stopwords file to load |
LuceneVersion | matchVersion | the Lucene version for cross version compatibility |
Returns
Type | Description |
---|---|
CharArraySet | a CharArraySet containing the distinct stopwords from the given file |
Exceptions
Type | Condition |
---|---|
IOException | if loading the stopwords throws an IOException |
LoadStopwordSet(TextReader, LuceneVersion)
Creates a CharArraySet from a file.
Declaration
protected static CharArraySet LoadStopwordSet(TextReader stopwords, LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
TextReader | stopwords | the stopwords reader to load |
LuceneVersion | matchVersion | the Lucene version for cross version compatibility |
Returns
Type | Description |
---|---|
CharArraySet | a CharArraySet containing the distinct stopwords from the given reader |
Exceptions
Type | Condition |
---|---|
IOException | if loading the stopwords throws an IOException |