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


Analyzer.h
Go to the documentation of this file.
1 // 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 ANALYZER_H
8 #define ANALYZER_H
9 
10 #include "CloseableThreadLocal.h"
11 
12 namespace Lucene {
13 
19 class LPPAPI Analyzer : public LuceneObject {
20 public:
21  virtual ~Analyzer();
23 
24 protected:
26 
27 public:
30  virtual TokenStreamPtr tokenStream(const String& fieldName, const ReaderPtr& reader) = 0;
31 
35  virtual TokenStreamPtr reusableTokenStream(const String& fieldName, const ReaderPtr& reader);
36 
45  virtual int32_t getPositionIncrementGap(const String& fieldName);
46 
53  virtual int32_t getOffsetGap(const FieldablePtr& field);
54 
56  virtual void close();
57 
58 protected:
61  virtual LuceneObjectPtr getPreviousTokenStream();
62 
65  virtual void setPreviousTokenStream(const LuceneObjectPtr& stream);
66 };
67 
68 }
69 
70 #endif
CloseableThreadLocal< LuceneObject > tokenStreams
Definition: Analyzer.h:22
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
boost::shared_ptr< Reader > ReaderPtr
Definition: LuceneTypes.h:547
An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index...
Definition: Analyzer.h:19
Base class for all Lucene classes.
Definition: LuceneObject.h:31
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< Fieldable > FieldablePtr
Definition: LuceneTypes.h:76
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition: LuceneTypes.h:63
General purpose thread-local map.
Definition: CloseableThreadLocal.h:16

clucene.sourceforge.net