concordia-library/concordia/anubis_search_result.hpp
2015-05-01 14:52:53 +02:00

54 lines
1.2 KiB
C++

#ifndef ANUBIS_SEARCH_RESULT_HDR
#define ANUBIS_SEARCH_RESULT_HDR
#include "concordia/common/config.hpp"
/*!
Class representing an example found by anubis search. Contains
the id of the example and anubis score of the search.
*/
class AnubisSearchResult {
public:
/*! Constructor.
\param exampleId the id of found example
\param score score of this example
*/
explicit AnubisSearchResult(const SUFFIX_MARKER_TYPE & exampleId,
const double score);
/*! Destructor.
*/
virtual ~AnubisSearchResult();
/*! Getter for example id.
\returns example id
*/
SUFFIX_MARKER_TYPE getExampleId() const {
return _exampleId;
}
/*! Getter for anubis score.
\returns anubis score of the example
*/
double getScore() const {
return _score;
}
/*! 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
*/
bool operator > (const AnubisSearchResult & other) const {
return (_score > other.getScore());
}
private:
SUFFIX_MARKER_TYPE _exampleId;
double _score;
};
#endif