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;
193 unsigned short nbOfResults = _resultList.size();
194 if (nbOfResults > 1) {
200 <<
" string partition overall matches at "
201 << oCombinedPercentage <<
"%");
#define OPENTREP_LOG_DEBUG(iToBeLogged)
void fromStream(std::istream &)
std::string describeShortKey() const
StringSet getCorrectedStringSet() const
void calculateEnvelopeWeights() const
std::string describeKey() const
void calculateCombinedWeights()
void toStream(std::ostream &) const
void calculateCodeMatches() const
void calculatePageRanks() const
void calculateHeuristicWeights() const
void setCombinedWeight(const Percentage_T &iPercentage)
std::string toString() const
void displayXapianPercentages() const
Class wrapping a set of Xapian documents having matched a given query string.
void displayXapianPercentages() const
const TravelQuery_T & getCorrectedTravelQuery() const
void calculatePageRanks()
const Percentage_T & getBestCombinedWeight() const
std::string toString() const
void calculateHeuristicWeights()
void calculateEnvelopeWeights()
void calculateCodeMatches()
void calculateCombinedWeights()
std::string TravelQuery_T
const Percentage_T K_DEFAULT_ATTENUATION_FCTR
std::string toString(const TokenList_T &iTokenList)
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
void push_back(const std::string &)