ept::popcon::Popcon Class Reference

#include <popcon.h>

Collaboration diagram for ept::popcon::Popcon:

Collaboration graph
[legend]

List of all members.


Detailed Description

Maps Packages to IDs and vice-versa.

This is used in building the Debtags fast index, which works representing tags and packages as int IDs.

Index building works like this: 1. The file all-popcon-results.txt.gz is downloaded from http://popcon.debian.org/all-popcon-results.txt.gz 2. The file is put in either ~/.popcon/all-popcon-results.txt.gz or in /var/lib/popcon/all-popcon-results.txt.gz 3. If the file is newer than the index, it will be automatically used to recompute the scores and rebuild the index.

Public Member Functions

 Popcon ()
time_t timestamp () const
 Get the timestamp of when the index was last updated.
bool hasData () const
 Return true if this data source has data, false if it's empty.
size_t submissions () const
 Return the total number of popcon submissions.
size_t size () const
 Get the number of packages in the index.
std::string name (size_t idx) const
 Get a package name by index.
float scoreByIndex (size_t idx) const
 Get the score by index.
float scoreByName (const std::string &name) const
 Get the score structure by package name.
float score (size_t idx) const
 Get the score by index.
float operator[] (int idx) const
 Get the score by index.
float score (const std::string &name) const
 Get the score by name.
float operator[] (const std::string &name) const
 Get the score structure by package name.

Classes

struct  GeneralInfo


Constructor & Destructor Documentation

ept::popcon::Popcon::Popcon (  ) 


Member Function Documentation

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

Get the timestamp of when the index was last updated.

Referenced by TestPopcon::fallbackValues().

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

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

Referenced by TestPopcon::fallbackValues().

size_t ept::popcon::Popcon::submissions (  )  const [inline]

Return the total number of popcon submissions.

Referenced by TestPopcon::basicAccess(), TestPopcon::fallbackValues(), and ept::popcon::Local::tfidf().

size_t ept::popcon::Popcon::size (  )  const [inline]

Get the number of packages in the index.

Referenced by TestPopcon::accessibility(), TestPopcon::basicAccess(), TestPopcon::fallbackValues(), and scoreByName().

std::string ept::popcon::Popcon::name ( size_t  idx  )  const [inline]

Get a package name by index.

If the index is not valid, returns the empty string.

References ept::popcon::Score::offset.

Referenced by TestPopcon::basicAccess(), and scoreByName().

float ept::popcon::Popcon::scoreByIndex ( size_t  idx  )  const [inline]

Get the score by index.

References ept::popcon::Score::score.

Referenced by operator[](), and score().

float ept::popcon::Popcon::scoreByName ( const std::string &  name  )  const

Get the score structure by package name.

References name(), score(), and size().

Referenced by operator[](), and score().

float ept::popcon::Popcon::score ( size_t  idx  )  const [inline]

float ept::popcon::Popcon::operator[] ( int  idx  )  const [inline]

Get the score by index.

References scoreByIndex().

float ept::popcon::Popcon::score ( const std::string &  name  )  const [inline]

Get the score by name.

References scoreByName().

float ept::popcon::Popcon::operator[] ( const std::string &  name  )  const [inline]

Get the score structure by package name.

References scoreByName().


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

Generated on Sat Jul 26 11:58:28 2008 for libept by  doxygen 1.5.6