ept::popcon::Local Class Reference

#include <local.h>

List of all members.


Detailed Description

Access the results of the local daily popcon scan.

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.
bool hasData () const
 Return true if this data source has data, false if it's empty.
float score (const std::string &pkg) const
 Return the local score of the package.
float tfidf (const Popcon &popcon, const std::string &pkg) const
 Return the TFIDF score of the package computed against the popcon information.
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.
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.

Protected Attributes

std::map
< std::string, float > 
m_scores
time_t m_timestamp

Constructor & Destructor Documentation

ept::popcon::Local::Local ( const std::string &  file = std::string("/var/log/popularity-contest")  ) 


Member Function Documentation

time_t ept::popcon::Local::timestamp (  )  const [inline]

Get the timestamp of the local popcon information.

bool ept::popcon::Local::hasData (  )  const [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.

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.

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.

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.


Member Data Documentation

std::map<std::string, float> ept::popcon::Local::m_scores [protected]

time_t ept::popcon::Local::m_timestamp [protected]


The documentation for this class was generated from the following files:
Generated on Sat Sep 15 21:33:09 2007 for libept by  doxygen 1.5.3