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);
234 for (ResultHolderList_T::const_iterator itResultHolder =
235 _resultHolderList.begin();
236 itResultHolder != _resultHolderList.end(); ++itResultHolder) {
238 assert (lResultHolder_ptr != NULL);
246 if (lMatchingPercentage > lMaxMatchingPercentage) {
247 lMaxMatchingPercentage = lMatchingPercentage;
248 _bestMatchingResultHolder = lResultHolder_ptr;
253 if (_bestMatchingResultHolder != NULL) {
255 <<
"' string has a weight of "
256 << lMaxMatchingPercentage
257 <<
"%. It is the following string partition: "
258 << _bestMatchingResultHolder->describeKey());
266 const bool doesBestMatchingResultHolderExist =
267 (_bestMatchingResultHolder != NULL);
268 return doesBestMatchingResultHolderExist;
#define OPENTREP_LOG_ERROR(iToBeLogged)
#define OPENTREP_LOG_DEBUG(iToBeLogged)
void calculatePageRanks() const
void calculateCodeMatches() const
void calculateHeuristicWeights() const
const ResultHolder & getBestMatchingResultHolder() const
void calculateCombinedWeights() const
void fromStream(std::istream &)
std::string toString() const
void calculateAllWeights()
bool chooseBestMatchingResultHolder()
StringSet getCorrectedStringSet() const
void displayXapianPercentages() const
const Percentage_T & getBestMatchingWeight() const
void calculateEnvelopeWeights() const
void toStream(std::ostream &) const
std::string describeShortKey() const
std::string describeKey() const
Class wrapping functions on a list of Result objects.
StringSet getCorrectedStringSet() const
void calculateEnvelopeWeights() const
void calculateCombinedWeights()
void calculateCodeMatches() const
void calculatePageRanks() const
void calculateHeuristicWeights() const
const Percentage_T & getCombinedWeight() const
std::string toString() const
void displayXapianPercentages() const
std::string toString(const TokenList_T &iTokenList)
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.