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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Explanation.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 EXPLANATION_H
8 #define EXPLANATION_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene
13 {
15  class LPPAPI Explanation : public LuceneObject
16  {
17  public:
18  Explanation(double value = 0, const String& description = EmptyString);
19  virtual ~Explanation();
20 
22 
23  protected:
24  double value; // the value of this node
25  String description; // what it represents
26  Collection<ExplanationPtr> details; // sub-explanations
27 
28  public:
34  virtual bool isMatch();
35 
37  virtual double getValue();
38 
40  virtual void setValue(double value);
41 
43  virtual String getDescription();
44 
46  virtual void setDescription(const String& description);
47 
49  virtual Collection<ExplanationPtr> getDetails();
50 
52  virtual void addDetail(ExplanationPtr detail);
53 
55  virtual String toString();
56 
58  virtual String toHtml();
59 
60  protected:
63  virtual String getSummary();
64 
65  virtual String toString(int32_t depth);
66  };
67 
71  class LPPAPI IDFExplanation : public LuceneObject
72  {
73  public:
74  virtual ~IDFExplanation();
76 
77  public:
79  virtual double getIdf() = 0;
80 
83  virtual String explain() = 0;
84  };
85 }
86 
87 #endif

clucene.sourceforge.net