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

Loading...
Searching...
No Matches
StopAnalyzer.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 STOPANALYZER_H
8#define STOPANALYZER_H
9
10#include "Analyzer.h"
11
12 namespace Lucene {
13
18 class LPPAPI StopAnalyzer : public Analyzer {
19 public:
21 StopAnalyzer(LuceneVersion::Version matchVersion);
22
24 StopAnalyzer(LuceneVersion::Version matchVersion, HashSet<String> stopWords);
25
27 StopAnalyzer(LuceneVersion::Version matchVersion, const String& stopwordsFile);
28
30 StopAnalyzer(LuceneVersion::Version matchVersion, const ReaderPtr& stopwords);
31
32 virtual ~StopAnalyzer();
33
34 LUCENE_CLASS(StopAnalyzer);
35
36 protected:
37 HashSet<String> stopWords;
38 bool enablePositionIncrements;
39
40 static const wchar_t* _ENGLISH_STOP_WORDS_SET[];
41
42 public:
44 static const HashSet<String> ENGLISH_STOP_WORDS_SET();
45
46 virtual TokenStreamPtr tokenStream(const String& fieldName, const ReaderPtr& reader);
47 virtual TokenStreamPtr reusableTokenStream(const String& fieldName, const ReaderPtr& reader);
48};
49
50}
51
52#endif
Analyzer.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::Analyzer
An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index...
Definition Analyzer.h:19
Lucene::HashSet
Utility template class to handle hash set collections that can be safely copied and shared.
Definition HashSet.h:17
Lucene::LuceneVersion::Version
Version
Definition Constants.h:40
Lucene::StopAnalyzer
Filters LetterTokenizer with LowerCaseFilter and StopFilter.
Definition StopAnalyzer.h:18
Lucene::StopAnalyzer::reusableTokenStream
virtual TokenStreamPtr reusableTokenStream(const String &fieldName, const ReaderPtr &reader)
Creates a TokenStream that is allowed to be re-used from the previous time that the same thread calle...
Lucene::StopAnalyzer::StopAnalyzer
StopAnalyzer(LuceneVersion::Version matchVersion, const String &stopwordsFile)
Builds an analyzer with the stop words from the given file.
Lucene::StopAnalyzer::StopAnalyzer
StopAnalyzer(LuceneVersion::Version matchVersion, HashSet< String > stopWords)
Builds an analyzer with the stop words from the given set.
Lucene::StopAnalyzer::StopAnalyzer
StopAnalyzer(LuceneVersion::Version matchVersion, const ReaderPtr &stopwords)
Builds an analyzer with the stop words from the given reader.
Lucene::StopAnalyzer::ENGLISH_STOP_WORDS_SET
static const HashSet< String > ENGLISH_STOP_WORDS_SET()
An unmodifiable set containing some common English words that are usually not useful for searching.
Lucene::StopAnalyzer::stopWords
HashSet< String > stopWords
Definition StopAnalyzer.h:37
Lucene::StopAnalyzer::tokenStream
virtual TokenStreamPtr tokenStream(const String &fieldName, const ReaderPtr &reader)
Creates a TokenStream which tokenizes all the text in the provided Reader. Must be able to handle nul...
Lucene::StopAnalyzer::enablePositionIncrements
bool enablePositionIncrements
Definition StopAnalyzer.h:38
Lucene::StopAnalyzer::~StopAnalyzer
virtual ~StopAnalyzer()
Lucene::StopAnalyzer::StopAnalyzer
StopAnalyzer(LuceneVersion::Version matchVersion)
Builds an analyzer which removes words in ENGLISH_STOP_WORDS_SET.
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::TokenStreamPtr
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition LuceneTypes.h:63
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:547

clucene.sourceforge.net