libept
|
Maps Packages to IDs and vice-versa. More...
#include <popcon.h>
Classes | |
struct | GeneralInfo |
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. |
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:
ept::popcon::Popcon::Popcon | ( | ) |
References ept::axi::timestamp().
|
inline |
Return true if this data source has data, false if it's empty.
Referenced by TestPopcon::fallbackValues().
|
inline |
Get a package name by index.
If the index is not valid, returns the empty string.
References ept::popcon::Score::offset.
|
inline |
Get the score by index.
References scoreByIndex().
|
inline |
Get the score structure by package name.
References scoreByName().
|
inline |
Get the score by index.
References scoreByIndex().
Referenced by TestPopcon::fallbackValues(), and ept::popcon::Local::tfidf().
|
inline |
Get the score by name.
References scoreByName().
|
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.
Referenced by operator[](), and score().
|
inline |
Get the number of packages in the index.
Referenced by TestPopcon::fallbackValues().
|
inline |
Return the total number of popcon submissions.
Referenced by TestPopcon::fallbackValues(), and ept::popcon::Local::tfidf().
|
inline |
Get the timestamp of when the index was last updated.
Referenced by TestPopcon::fallbackValues().