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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DefaultSimilarity.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 DEFAULTSIMILARITY_H
8 #define DEFAULTSIMILARITY_H
9 
10 #include "Similarity.h"
11 
12 namespace Lucene
13 {
15  class LPPAPI DefaultSimilarity : public Similarity
16  {
17  public:
19  virtual ~DefaultSimilarity();
20 
22 
23  protected:
24  bool discountOverlaps; // Default false
25 
26  public:
30  virtual double computeNorm(const String& fieldName, FieldInvertStatePtr state);
31 
33  virtual double lengthNorm(const String& fieldName, int32_t numTokens);
34 
36  virtual double queryNorm(double sumOfSquaredWeights);
37 
39  virtual double tf(double freq);
40 
42  virtual double sloppyFreq(int32_t distance);
43 
45  virtual double idf(int32_t docFreq, int32_t numDocs);
46 
48  virtual double coord(int32_t overlap, int32_t maxOverlap);
49 
53  void setDiscountOverlaps(bool v);
54 
56  bool getDiscountOverlaps();
57  };
58 }
59 
60 #endif

clucene.sourceforge.net