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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FuzzyTermEnum.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 FUZZYTERMENUM_H
8 #define FUZZYTERMENUM_H
9 
10 #include "FilteredTermEnum.h"
11 
12 namespace Lucene {
13 
18 class LPPAPI FuzzyTermEnum : public FilteredTermEnum {
19 public:
29  FuzzyTermEnum(const IndexReaderPtr& reader, const TermPtr& term, double minSimilarity, int32_t prefixLength);
30  FuzzyTermEnum(const IndexReaderPtr& reader, const TermPtr& term, double minSimilarity);
31  FuzzyTermEnum(const IndexReaderPtr& reader, const TermPtr& term);
32 
33  virtual ~FuzzyTermEnum();
34 
36 
37 protected:
41 
42  double _similarity;
43  bool _endEnum;
44 
46  String field;
47  String text;
48  String prefix;
49 
51  double scale_factor;
52 
53 public:
54  virtual double difference();
55  virtual bool endEnum();
56  virtual void close();
57 
58 protected:
59  void ConstructTermEnum(const IndexReaderPtr& reader, const TermPtr& term, double minSimilarity, int32_t prefixLength);
60 
63  virtual bool termCompare(const TermPtr& term);
64 
105  double similarity(const String& target);
106 
111  int32_t calculateMaxDistance(int32_t m);
112 };
113 
114 }
115 
116 #endif

clucene.sourceforge.net