CLucene - a full-featured, c++ search engine
API Documentation


lucene::analysis::StopFilter Class Reference

Removes stop words from a token stream. More...

#include <Analyzers.h>

Inheritance diagram for lucene::analysis::StopFilter:

lucene::analysis::TokenFilter lucene::analysis::TokenStream

Public Member Functions

 StopFilter (TokenStream *in, bool deleteTokenStream, const TCHAR **_stopWords, const bool _ignoreCase=false)
virtual ~StopFilter ()
 StopFilter (TokenStream *in, bool deleteTokenStream, CLTCSetList *stopTable, bool _deleteStopTable=false)
 Constructs a filter which removes words from the input TokenStream that are named in the CLSetList.
bool next (Token *token)
 Returns the next input Token whose termText() is not a stop word.
bool getEnablePositionIncrements () const
void setEnablePositionIncrements (const bool enable)
 Set to true to make this StopFilter enable position increments to result tokens.

Static Public Member Functions

static void fillStopTable (CLTCSetList *stopTable, const TCHAR **stopWords, const bool _ignoreCase=false)
 Builds a Hashtable from an array of stop words, appropriate for passing into the StopFilter constructor.
static bool getEnablePositionIncrementsDefault ()
static void setEnablePositionIncrementsDefault (const bool defaultValue)
 Set the default position increments behavior of every StopFilter created from now on.

Static Public Attributes

static bool ENABLE_POSITION_INCREMENTS_DEFAULT

Detailed Description

Removes stop words from a token stream.

Constructor & Destructor Documentation

lucene::analysis::StopFilter::StopFilter ( TokenStream in,
bool  deleteTokenStream,
const TCHAR **  _stopWords,
const bool  _ignoreCase = false 
)

virtual lucene::analysis::StopFilter::~StopFilter (  )  [virtual]

lucene::analysis::StopFilter::StopFilter ( TokenStream in,
bool  deleteTokenStream,
CLTCSetList stopTable,
bool  _deleteStopTable = false 
)

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


Member Function Documentation

static void lucene::analysis::StopFilter::fillStopTable ( CLTCSetList stopTable,
const TCHAR **  stopWords,
const bool  _ignoreCase = false 
) [static]

Builds a Hashtable from an array of stop words, appropriate for passing into the StopFilter constructor.

This permits this table construction to be cached once when an Analyzer is constructed. Note: the stopWords list must be a static list because the strings are not copied

bool lucene::analysis::StopFilter::next ( Token token  )  [virtual]

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

Implements lucene::analysis::TokenStream.

static bool lucene::analysis::StopFilter::getEnablePositionIncrementsDefault (  )  [static]

See also:
setEnablePositionIncrementsDefault(boolean).

static void lucene::analysis::StopFilter::setEnablePositionIncrementsDefault ( const bool  defaultValue  )  [static]

Set the default position increments behavior of every StopFilter created from now on.

Note: behavior of a single StopFilter instance can be modified with setEnablePositionIncrements(boolean). This static method allows control over behavior of classes using StopFilters internally, for example StandardAnalyzer.

Default : false.

See also:
setEnablePositionIncrements(boolean).

bool lucene::analysis::StopFilter::getEnablePositionIncrements (  )  const

See also:
setEnablePositionIncrements(boolean).

void lucene::analysis::StopFilter::setEnablePositionIncrements ( const bool  enable  ) 

Set to true to make this StopFilter enable position increments to result tokens.

When set, when a token is stopped (omitted), the position increment of the following token is incremented.

Default: see setEnablePositionIncrementsDefault(boolean).


Field Documentation


The documentation for this class was generated from the following file:

clucene.sourceforge.net