OpenTREP Logo  0.07.11
C++ Open Travel Request Parsing Library
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 
109  void calculateAllWeights();
110 
117 
118 
119  public:
120  // /////////// Display support methods /////////
126  void toStream (std::ostream&) const;
127 
133  void fromStream (std::istream&);
134 
138  std::string toString() const;
139 
144  std::string describeKey() const;
145 
150  std::string describeShortKey() const;
151 
152 
153  private:
154  // ////////////// Constructors and Destructors /////////////
162  ~ResultCombination ();
166  void init ();
167 
168  private:
177 
178 
179  private:
180  // /////////////// Attributes ////////////////
184  const TravelQuery_T _travelQuery;
185 
189  ResultHolderList_T _resultHolderList;
190 
194  const ResultHolder* _bestMatchingResultHolder;
195  };
196 
197 }
198 #endif // __OPENTREP_BOM_RESULTCOMBINATION_HPP
double Percentage_T
const ResultHolderList_T & getResultHolderList() const
const Percentage_T & getBestMatchingWeight() const
StringSet getCorrectedStringSet() const
Class wrapping functions on a list of Result objects.
const ResultHolder & getBestMatchingResultHolder() const
std::list< ResultHolder * > ResultHolderList_T
std::string describeShortKey() const
std::string describeKey() const
Class wrapping functions on a list of ResultHolder objects.
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:17
const TravelQuery_T & getQueryString() const
void toStream(std::ostream &) const
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
Definition: StringSet.hpp:19
std::string TravelQuery_T
void fromStream(std::istream &)