Go to the documentation of this file.00001 #ifndef EPT_POPCON_LOCAL_H
00002 #define EPT_POPCON_LOCAL_H
00003
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <string>
00028 #include <vector>
00029 #include <map>
00030
00031 namespace ept {
00032 namespace popcon {
00033
00034 class Popcon;
00035
00039 class Local
00040 {
00041 protected:
00042 std::map<std::string, float> m_scores;
00043 time_t m_timestamp;
00044
00045 public:
00046 Local(const std::string& file = std::string("/var/log/popularity-contest"));
00047
00049 time_t timestamp() const { return m_timestamp; }
00050
00052 bool hasData() const { return m_timestamp != 0; }
00053
00057 float score(const std::string& pkg) const;
00058
00066 float tfidf(const Popcon& popcon, const std::string& pkg) const;
00067
00072 std::vector< std::pair<std::string, float> > scores() const;
00073
00080 std::vector< std::pair<std::string, float> > tfidf(const Popcon& popcon) const;
00081 };
00082
00083 }
00084 }
00085
00086
00087 #endif