1 #ifndef EPT_POPCON_LOCAL_H 2 #define EPT_POPCON_LOCAL_H 46 Local(
const std::string& file = std::string(
"/var/log/popularity-contest"));
52 bool hasData()
const {
return m_timestamp != 0; }
57 float score(
const std::string& pkg)
const;
66 float tfidf(
const Popcon& popcon,
const std::string& pkg)
const;
72 std::vector< std::pair<std::string, float> >
scores()
const;
80 std::vector< std::pair<std::string, float> >
tfidf(
const Popcon& popcon)
const;
std::map< std::string, float > m_scores
Definition: local.h:42
time_t m_timestamp
Definition: local.h:43
Maps Packages to IDs and vice-versa.
Definition: popcon.h:72
bool hasData() const
Return true if this data source has data, false if it's empty.
Definition: local.h:52
-*- C++ -*- (c) 2006, 2007 Petr Rockai me@mornfall.net
Definition: apt.cc:43
time_t timestamp() const
Get the timestamp of the local popcon information.
Definition: local.h:49
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.
Definition: local.cc:136
Access the results of the local daily popcon scan.
Definition: local.h:39
Local(const std::string &file=std::string("/var/log/popularity-contest"))
Definition: local.cc:75
float tfidf(const Popcon &popcon, const std::string &pkg) const
Return the TFIDF score of the package computed against the popcon information.
Definition: local.cc:125
float score(const std::string &pkg) const
Return the local score of the package.
Definition: local.cc:112