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.

References m_timestamp.

bool ept::popcon::Local::hasData (  )  const [inline]

Return true if this data source has data, false if it's empty.

References m_timestamp.

float ept::popcon::Local::score ( const std::string &  pkg  )  const

Return the local score of the package.

References m_scores.

Referenced by TestPopconLocal::basicAccess(), and tfidf().

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 score(), ept::popcon::Popcon::score(), and ept::popcon::Popcon::submissions().

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 m_scores.

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 m_scores, ept::popcon::Popcon::score(), and ept::popcon::Popcon::submissions().


Member Data Documentation

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

Referenced by Local(), score(), scores(), and tfidf().

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

Referenced by hasData(), Local(), and timestamp().


The documentation for this class was generated from the following files:

Generated on Sat Jul 26 12:38:57 2008 for libept by  doxygen 1.5.6