2014-03-11 14:32:10 +01:00
|
|
|
#ifndef ANUBIS_SEARCH_RESULT_HDR
|
|
|
|
#define ANUBIS_SEARCH_RESULT_HDR
|
|
|
|
|
|
|
|
#include "concordia/common/config.hpp"
|
|
|
|
|
|
|
|
/*!
|
2015-04-30 22:22:54 +02:00
|
|
|
Class representing an example found by anubis search. Contains
|
|
|
|
the id of the example and anubis score of the search.
|
2014-03-11 14:32:10 +01:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
class AnubisSearchResult {
|
|
|
|
public:
|
2015-04-30 22:22:54 +02:00
|
|
|
/*! Constructor.
|
|
|
|
\param exampleId the id of found example
|
|
|
|
\param score score of this example
|
|
|
|
*/
|
2014-04-29 14:46:04 +02:00
|
|
|
explicit AnubisSearchResult(const SUFFIX_MARKER_TYPE & exampleId,
|
|
|
|
const double score);
|
2014-03-11 14:32:10 +01:00
|
|
|
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~AnubisSearchResult();
|
|
|
|
|
2015-04-30 22:22:54 +02:00
|
|
|
/*! Getter for example id.
|
|
|
|
\returns example id
|
|
|
|
*/
|
2014-03-11 14:32:10 +01:00
|
|
|
SUFFIX_MARKER_TYPE getExampleId() const {
|
|
|
|
return _exampleId;
|
|
|
|
}
|
|
|
|
|
2015-04-30 22:22:54 +02:00
|
|
|
/*! Getter for anubis score.
|
|
|
|
\returns anubis score of the example
|
|
|
|
*/
|
2014-03-11 14:32:10 +01:00
|
|
|
double getScore() const {
|
|
|
|
return _score;
|
|
|
|
}
|
|
|
|
|
2015-04-30 22:22:54 +02:00
|
|
|
/*! Operator "greater than", used to sort objects of this class.
|
|
|
|
\returns true if the score of the current result is larger than
|
|
|
|
the score of another result
|
|
|
|
*/
|
2015-04-16 11:39:39 +02:00
|
|
|
bool operator > (const AnubisSearchResult & other) const {
|
|
|
|
return (_score > other.getScore());
|
|
|
|
}
|
2015-05-01 14:52:53 +02:00
|
|
|
|
2014-03-11 14:32:10 +01:00
|
|
|
private:
|
|
|
|
SUFFIX_MARKER_TYPE _exampleId;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2014-03-11 14:32:10 +01:00
|
|
|
double _score;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|