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


Loading...
Searching...
No Matches
StopFilter.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef STOPFILTER_H
8#define STOPFILTER_H
9
10#include "TokenFilter.h"
11
12namespace Lucene {
13
15class LPPAPI StopFilter : public TokenFilter {
16public:
28 StopFilter(bool enablePositionIncrements, const TokenStreamPtr& input, HashSet<String> stopWords, bool ignoreCase = false);
29 StopFilter(bool enablePositionIncrements, const TokenStreamPtr& input, const CharArraySetPtr& stopWords, bool ignoreCase = false);
30
31 virtual ~StopFilter();
32
34
35protected:
38
41
42public:
45
47 virtual bool incrementToken();
48
52
55
63 void setEnablePositionIncrements(bool enable);
64};
65
66}
67
68#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Utility template class to handle hash set collections that can be safely copied and shared.
Definition HashSet.h:17
Version
Definition Constants.h:40
Removes stop words from a token stream.
Definition StopFilter.h:15
bool getEnablePositionIncrements()
bool enablePositionIncrements
Definition StopFilter.h:37
virtual bool incrementToken()
Returns the next input Token whose term() is not a stop word.
static HashSet< String > makeStopSet(Collection< String > stopWords)
Builds a Set from an array of stop words, appropriate for passing into the StopFilter constructor.
StopFilter(bool enablePositionIncrements, const TokenStreamPtr &input, HashSet< String > stopWords, bool ignoreCase=false)
Construct a token stream filtering the given input. If stopWords is an instance of CharArraySet (true...
StopFilter(bool enablePositionIncrements, const TokenStreamPtr &input, const CharArraySetPtr &stopWords, bool ignoreCase=false)
virtual ~StopFilter()
void setEnablePositionIncrements(bool enable)
If true, this StopFilter will preserve positions of the incoming tokens (ie, accumulate and set posit...
PositionIncrementAttributePtr posIncrAtt
Definition StopFilter.h:40
TermAttributePtr termAtt
Definition StopFilter.h:39
static bool getEnablePositionIncrementsVersionDefault(LuceneVersion::Version matchVersion)
Returns version-dependent default for enablePositionIncrements. Analyzers that embed StopFilter use t...
CharArraySetPtr stopWords
Definition StopFilter.h:36
A TokenFilter is a TokenStream whose input is another TokenStream.
Definition TokenFilter.h:18
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< PositionIncrementAttribute > PositionIncrementAttributePtr
Definition LuceneTypes.h:45
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition LuceneTypes.h:63
boost::shared_ptr< CharArraySet > CharArraySetPtr
Definition LuceneTypes.h:24
boost::shared_ptr< TermAttribute > TermAttributePtr
Definition LuceneTypes.h:58

clucene.sourceforge.net