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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FuzzyTermEnum.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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 {
20 public:
30 FuzzyTermEnum(IndexReaderPtr reader, TermPtr term, double minSimilarity, int32_t prefixLength);
31 FuzzyTermEnum(IndexReaderPtr reader, TermPtr term, double minSimilarity);
32 FuzzyTermEnum(IndexReaderPtr reader, TermPtr term);
33
34 virtual ~FuzzyTermEnum();
35
36 LUCENE_CLASS(FuzzyTermEnum);
37
38 protected:
40 Collection<int32_t> p;
41 Collection<int32_t> d;
42
43 double _similarity;
44 bool _endEnum;
45
46 TermPtr searchTerm;
47 String field;
48 String text;
49 String prefix;
50
51 double minimumSimilarity;
52 double scale_factor;
53
54 public:
55 virtual double difference();
56 virtual bool endEnum();
57 virtual void close();
58
59 protected:
60 void ConstructTermEnum(IndexReaderPtr reader, TermPtr term, double minSimilarity, int32_t prefixLength);
61
64 virtual bool termCompare(TermPtr term);
65
106 double similarity(const String& target);
107
112 int32_t calculateMaxDistance(int32_t m);
113 };
114 }
115
116 #endif

clucene.sourceforge.net