18 ResultCombination::ResultCombination()
19 : _travelQuery (
""), _bestMatchingResultHolder (NULL) {
24 ResultCombination::ResultCombination (
const ResultCombination&)
25 : _travelQuery (
""), _bestMatchingResultHolder (NULL) {
30 ResultCombination::ResultCombination (
const TravelQuery_T& iQueryString)
31 : _travelQuery (iQueryString), _bestMatchingResultHolder (NULL) {
36 ResultCombination::~ResultCombination() {
37 _bestMatchingResultHolder = NULL;
41 void ResultCombination::init () {
42 _resultHolderList.clear();
47 if (_bestMatchingResultHolder == NULL) {
48 std::ostringstream oStr;
49 oStr <<
"There is no best matching ResultHolder object for the given "
50 <<
"query string: '" << _travelQuery <<
"'";
54 assert (_bestMatchingResultHolder != NULL);
55 return *_bestMatchingResultHolder;
74 std::ostringstream oStr;
86 std::ostringstream oStr;
89 for (ResultHolderList_T::const_iterator itResultHolder =
90 _resultHolderList.begin();
91 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
93 assert (lResultHolder_ptr != NULL);
95 oStr <<
" ==> " << std::endl << lResultHolder_ptr->
toString();
113 for (ResultHolderList_T::const_iterator itResultHolder =
114 _resultHolderList.begin();
115 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
117 assert (lResultHolder_ptr != NULL);
127 for (ResultHolderList_T::const_iterator itResultHolder =
128 _resultHolderList.begin();
129 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
131 assert (lResultHolder_ptr != NULL);
141 for (ResultHolderList_T::const_iterator itResultHolder =
142 _resultHolderList.begin();
143 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
145 assert (lResultHolder_ptr != NULL);
155 for (ResultHolderList_T::const_iterator itResultHolder =
156 _resultHolderList.begin();
157 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
159 assert (lResultHolder_ptr != NULL);
169 for (ResultHolderList_T::const_iterator itResultHolder =
170 _resultHolderList.begin();
171 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
173 assert (lResultHolder_ptr != NULL);
183 for (ResultHolderList_T::const_iterator itResultHolder =
184 _resultHolderList.begin();
185 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
187 assert (lResultHolder_ptr != NULL);
200 for (ResultHolderList_T::const_iterator itResultHolder =
201 _resultHolderList.begin();
202 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
204 assert (lResultHolder_ptr != NULL);
212 if (lMatchingPercentage > lMaxMatchingPercentage) {
213 lMaxMatchingPercentage = lMatchingPercentage;
214 _bestMatchingResultHolder = lResultHolder_ptr;
219 if (_bestMatchingResultHolder != NULL) {
221 <<
"' string has a weight of "
222 << lMaxMatchingPercentage
223 <<
"%. It is the following string partition: "
232 const bool doesBestMatchingResultHolderExist =
233 (_bestMatchingResultHolder != NULL);
234 return doesBestMatchingResultHolderExist;
void calculateEnvelopeWeights() const
bool chooseBestMatchingResultHolder()
#define OPENTREP_LOG_ERROR(iToBeLogged)
#define OPENTREP_LOG_DEBUG(iToBeLogged)
void calculateCodeMatches() const
const ResultHolder & getBestMatchingResultHolder() const
void calculateHeuristicWeights() const
StringSet getCorrectedStringSet() const
void calculateCodeMatches() const
const Percentage_T & getCombinedWeight() const
std::string toString() const
void toStream(std::ostream &) const
void calculateHeuristicWeights() const
void calculatePageRanks() const
std::string describeShortKey() const
void calculateCombinedWeights()
void calculateCombinedWeights() const
const Percentage_T & getBestMatchingWeight() const
Class wrapping functions on a list of Result objects.
std::string describeKey() const
void calculateEnvelopeWeights() const
void displayXapianPercentages() const
std::string toString() const
std::string describeKey() const
StringSet getCorrectedStringSet() const
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
std::string TravelQuery_T
void fromStream(std::istream &)
void calculatePageRanks() const
void displayXapianPercentages() const