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


Loading...
Searching...
No Matches
NGramAnalyzer.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 NGRAMANALYZER_H
8#define NGRAMANALYZER_H
9
10#include "Analyzer.h"
11
12namespace Lucene {
13
15class LPPAPI NGramAnalyzer : public Analyzer {
16public:
18 NGramAnalyzer(int32_t minGram, int32_t maxGram);
19 virtual ~NGramAnalyzer();
20
22
23protected:
24 int32_t minGram;
25 int32_t maxGram;
26
27public:
28 virtual TokenStreamPtr tokenStream(const String& fieldName, const ReaderPtr& reader);
29 virtual TokenStreamPtr reusableTokenStream(const String& fieldName, const ReaderPtr& reader);
30};
31
32}
33
34#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index...
Definition Analyzer.h:19
An Analyzer that uses NGramTokenizer.
Definition NGramAnalyzer.h:15
NGramAnalyzer(int32_t minGram, int32_t maxGram)
int32_t minGram
Definition NGramAnalyzer.h:24
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...
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...
int32_t maxGram
Definition NGramAnalyzer.h:25
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition LuceneTypes.h:66
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:550

clucene.sourceforge.net