OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResultCombination.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_BOM_RESULTCOMBINATION_HPP
2 #define __OPENTREP_BOM_RESULTCOMBINATION_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // OpenTrep
11 
12 // Forward declarations
13 namespace Xapian {
14  class Database;
15 }
16 
17 namespace OPENTREP {
18 
19  // Forward declarations
20  struct StringSet;
21 
25  class ResultCombination : public BomAbstract {
26  friend class FacResultCombination;
27  public:
28  // ////////////// Getters /////////////
32  const TravelQuery_T& getQueryString() const {
33  return _travelQuery;
34  }
35 
40  return _resultHolderList;
41  }
42 
46  bool hasFullTextMatched() const {
47  return (_bestMatchingResultHolder != NULL);
48  }
49 
56 
62  const Percentage_T& getBestMatchingWeight() const;
63 
71 
72 
73  public:
74  // /////////// Business methods ///////////
78  void displayXapianPercentages() const;
79 
83  void calculateEnvelopeWeights() const;
84 
89  void calculateCodeMatches() const;
90 
94  void calculatePageRanks() const;
95 
99  void calculateHeuristicWeights() const;
100 
104  void calculateCombinedWeights() const;
105 
112 
113 
114  public:
115  // /////////// Display support methods /////////
121  void toStream (std::ostream&) const;
122 
128  void fromStream (std::istream&);
129 
133  std::string toString() const;
134 
139  std::string describeKey() const;
140 
145  std::string describeShortKey() const;
146 
147 
148  private:
149  // ////////////// Constructors and Destructors /////////////
157  ~ResultCombination ();
161  void init ();
162 
163  private:
172 
173 
174  private:
175  // /////////////// Attributes ////////////////
179  const TravelQuery_T _travelQuery;
180 
184  ResultHolderList_T _resultHolderList;
185 
189  const ResultHolder* _bestMatchingResultHolder;
190  };
191 
192 }
193 #endif // __OPENTREP_BOM_RESULTCOMBINATION_HPP
double Percentage_T
const ResultHolder & getBestMatchingResultHolder() const
StringSet getCorrectedStringSet() const
std::string toString() const
void toStream(std::ostream &) const
std::string describeShortKey() const
const Percentage_T & getBestMatchingWeight() const
const TravelQuery_T & getQueryString() const
Class wrapping functions on a list of Result objects.
std::list< ResultHolder * > ResultHolderList_T
Class wrapping functions on a list of ResultHolder objects.
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:17
std::string describeKey() const
const ResultHolderList_T & getResultHolderList() const
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
Definition: StringSet.hpp:19
std::string TravelQuery_T
void fromStream(std::istream &)