libept
|
Access the results of the local daily popcon scan. More...
#include <local.h>
Public Member Functions | |
Local (const std::string &file=std::string("/var/log/popularity-contest")) | |
time_t | timestamp () const |
Get the timestamp of the local popcon information. More... | |
bool | hasData () const |
Return true if this data source has data, false if it's empty. More... | |
float | score (const std::string &pkg) const |
Return the local score of the package. More... | |
float | tfidf (const Popcon &popcon, const std::string &pkg) const |
Return the TFIDF score of the package computed against the popcon information. More... | |
std::vector< std::pair < std::string, float > > | scores () const |
Read the local popcon vote and return the list of packages and their local scores, sorted by ascending score. More... | |
std::vector< std::pair < std::string, float > > | tfidf (const Popcon &popcon) const |
Read the local popcon vote and return the list of packages and their TFIDF scores computed against the popcon information. More... | |
Protected Attributes | |
std::map< std::string, float > | m_scores |
time_t | m_timestamp |
Access the results of the local daily popcon scan.
ept::popcon::Local::Local | ( | const std::string & | file = std::string("/var/log/popularity-contest") | ) |
References ept::axi::timestamp().
|
inline |
Return true if this data source has data, false if it's empty.
float ept::popcon::Local::score | ( | const std::string & | pkg | ) | const |
Return the local score of the package.
Referenced by TestPopconLocal::basicAccess().
std::vector< std::pair< std::string, float > > ept::popcon::Local::scores | ( | ) | const |
Read the local popcon vote and return the list of packages and their local scores, sorted by ascending score.
References res.
float ept::popcon::Local::tfidf | ( | const Popcon & | popcon, |
const std::string & | pkg | ||
) | const |
Return the TFIDF score of the package computed against the popcon information.
The TFIDF score is high when a package is representative of this system, that is, it is used in this system and not much used in other systems.
References ept::popcon::Popcon::score(), and ept::popcon::Popcon::submissions().
Referenced by TestPopconLocal::basicAccess().
std::vector< std::pair< std::string, float > > ept::popcon::Local::tfidf | ( | const Popcon & | popcon | ) | const |
Read the local popcon vote and return the list of packages and their TFIDF scores computed against the popcon information.
The packages will be sorted by ascending score.
References res, ept::popcon::Popcon::score(), and ept::popcon::Popcon::submissions().
|
inline |
Get the timestamp of the local popcon information.
References m_timestamp.
|
protected |
|
protected |
Referenced by timestamp().