Document Fragments Ranking. More...
#include <gdocfragmentrank.h>
Public Member Functions | |
GDocFragmentRank (GDocFragment *fragment, double ranking=0.0, const R::RString info=R::RString::Null, bool delfragment=false) | |
int | Compare (const GDocFragmentRank &ranking) const |
int | Compare (const GDocFragment::Search &search) const |
int | Compare (const R::RString &info) const |
GDocFragment * | GetFragment (void) const |
double | GetRanking (void) |
R::RString | GetInfo (void) const |
void | SetRanking (double ranking) |
~GDocFragmentRank (void) | |
Static Public Member Functions | |
static int | SortOrderRanking (const void *a, const void *b) |
Protected Attributes | |
GDocFragment * | Fragment |
bool | DelFragment |
double | Ranking |
R::RString | Info |
Detailed Description
Document Fragments Ranking.
The GDocFragmentRank class provides a triplet (document fragment,ranking,info) that represents the ranking of a document in a given situation (search, suggestion, etc.).
Constructor & Destructor Documentation
GDocFragmentRank | ( | GDocFragment * | fragment, |
double | ranking = 0.0 , |
||
const R::RString | info = R::RString::Null , |
||
bool | delfragment = false |
||
) |
Create a document ranking.
- Parameters
-
fragment Document fragment. ranking Ranking of the document. info Information. delfragment Define if the fragment is deleted by the destructor. By default, it is false.
~GDocFragmentRank | ( | void | ) |
Destructor.
Member Function Documentation
int Compare | ( | const GDocFragmentRank & | ranking | ) | const |
Compare two rankings by using first the fragment and then the information.
- Parameters
-
ranking Ranking to compare with.
- Returns
- -1,0 or +1 depending of the comparison.
int Compare | ( | const GDocFragment::Search & | search | ) | const |
Compare two rankings by using the fragment.
- Parameters
-
ranking Ranking to compare with.
- Returns
- -1,0 or +1 depending of the comparison.
int Compare | ( | const R::RString & | info | ) | const |
Compare two rankings by using the information.
- Parameters
-
info Information to compare with.
- Returns
- -1,0 or +1 depending of the comparison.
GDocFragment* GetFragment | ( | void | ) | const |
Get the document fragment.
- Returns
- a pointer to a GDocFragment.
double GetRanking | ( | void | ) |
- Returns
- the ranking of the document fragment.
R::RString GetInfo | ( | void | ) | const |
- Returns
- the information associated with a suggestion.
void SetRanking | ( | double | ranking | ) |
Set the ranking of a document fragment.
- Parameters
-
ranking Ranking.
|
static |
Static function used to order the ranking (the highest first). This function can be used with the RContainer::ReOrder method.
- Parameters
-
a Pointer to the first object. b Pointer to the second object.
Member Data Documentation
|
protected |
Document fragment.
|
protected |
Should the fragment be free by the class?
|
protected |
Ranking of the document.
|
protected |
An information about the ranking.