19 ResultHolder::ResultHolder (
const TravelQuery_T& iQueryString,
20 const Xapian::Database& iDatabase)
21 : _resultCombination (NULL),
22 _queryString (iQueryString), _database (iDatabase) {
27 ResultHolder::~ResultHolder () {
31 void ResultHolder::init () {
32 _resultCombination = NULL;
38 std::ostringstream oStr;
50 std::ostringstream oStr;
53 unsigned short idx = 0;
54 for (ResultList_T::const_iterator itResult = _resultList.begin();
55 itResult != _resultList.end(); ++itResult, ++idx) {
56 const Result* lResult_ptr = *itResult;
57 assert (lResult_ptr != NULL);
62 oStr <<
" ==> " << std::endl << lResult_ptr->
toString();
80 for (ResultList_T::const_iterator itResult = _resultList.begin();
81 itResult != _resultList.end(); ++itResult) {
82 const Result* lResult_ptr = *itResult;
83 assert (lResult_ptr != NULL);
88 oStringSet.
push_back (lCorrectedQueryString);
98 for (ResultList_T::const_iterator itResult = _resultList.begin();
99 itResult != _resultList.end(); ++itResult) {
100 Result* lResult_ptr = *itResult;
101 assert (lResult_ptr != NULL);
111 for (ResultList_T::const_iterator itResult = _resultList.begin();
112 itResult != _resultList.end(); ++itResult) {
113 Result* lResult_ptr = *itResult;
114 assert (lResult_ptr != NULL);
124 for (ResultList_T::const_iterator itResult = _resultList.begin();
125 itResult != _resultList.end(); ++itResult) {
126 Result* lResult_ptr = *itResult;
127 assert (lResult_ptr != NULL);
137 for (ResultList_T::const_iterator itResult = _resultList.begin();
138 itResult != _resultList.end(); ++itResult) {
139 Result* lResult_ptr = *itResult;
140 assert (lResult_ptr != NULL);
150 for (ResultList_T::const_iterator itResult = _resultList.begin();
151 itResult != _resultList.end(); ++itResult) {
152 Result* lResult_ptr = *itResult;
153 assert (lResult_ptr != NULL);
165 if (_resultList.empty() ==
true) {
166 oCombinedPercentage = 0.0;
170 for (ResultList_T::const_iterator itResult = _resultList.begin();
171 itResult != _resultList.end(); ++itResult) {
172 Result* lResult_ptr = *itResult;
173 assert (lResult_ptr != NULL);
183 oCombinedPercentage *= lPercentage / 100.0;
192 unsigned short nbOfResults = _resultList.size();
193 if (nbOfResults > 1) {
199 <<
" string partition overall matches at "
200 << oCombinedPercentage <<
"%");
void setCombinedWeight(const Percentage_T &iPercentage)
#define OPENTREP_LOG_DEBUG(iToBeLogged)
void calculateCombinedWeights()
const TravelQuery_T & getCorrectedTravelQuery() const
void fromStream(std::istream &)
void calculateCodeMatches() const
void calculateHeuristicWeights() const
void calculatePageRanks() const
void displayXapianPercentages() const
std::string describeShortKey() const
const Percentage_T & getBestCombinedWeight() const
void calculateCombinedWeights()
std::string describeKey() const
void calculateEnvelopeWeights() const
void displayXapianPercentages() const
std::string toString() const
const Percentage_T K_DEFAULT_ATTENUATION_FCTR
std::string toString() const
void calculateHeuristicWeights()
void calculatePageRanks()
StringSet getCorrectedStringSet() const
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
std::string TravelQuery_T
void push_back(const std::string &)
void toStream(std::ostream &) const
void calculateEnvelopeWeights()
void calculateCodeMatches()
Class wrapping a set of Xapian documents having matched a given query string.