OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
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
13namespace Xapian {
14 class Database;
15}
16
17namespace OPENTREP {
18
19 // Forward declarations
20 struct StringSet;
21
25 class ResultCombination : public BomAbstract {
27 public:
28 // ////////////// Getters /////////////
33 return _travelQuery;
34 }
35
40 return _resultHolderList;
41 }
42
46 bool hasFullTextMatched() const {
47 return (_bestMatchingResultHolder != NULL);
48 }
49
56
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 /////////////
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
Class wrapping functions on a list of ResultHolder objects.
const ResultHolder & getBestMatchingResultHolder() const
const TravelQuery_T & getQueryString() const
StringSet getCorrectedStringSet() const
const ResultHolderList_T & getResultHolderList() const
const Percentage_T & getBestMatchingWeight() const
void toStream(std::ostream &) const
std::string describeShortKey() const
Class wrapping functions on a list of Result objects.
std::list< ResultHolder * > ResultHolderList_T
std::string TravelQuery_T
double Percentage_T
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
Definition StringSet.hpp:19