|
libept
|
Maps Packages to IDs and vice-versa. More...
#include <popcon.h>
Public Member Functions | |
| Popcon () | |
| time_t | timestamp () const |
| Get the timestamp of when the index was last updated. More... | |
| bool | hasData () const |
| Return true if this data source has data, false if it's empty. More... | |
| size_t | submissions () const |
| Return the total number of popcon submissions. More... | |
| size_t | size () const |
| Get the number of packages in the index. More... | |
| std::string | name (size_t idx) const |
| Get a package name by index. More... | |
| float | scoreByIndex (size_t idx) const |
| Get the score by index. More... | |
| float | scoreByName (const std::string &name) const |
| Get the score structure by package name. More... | |
| float | score (size_t idx) const |
| Get the score by index. More... | |
| float | operator[] (int idx) const |
| Get the score by index. More... | |
| float | score (const std::string &name) const |
| Get the score by name. More... | |
| float | operator[] (const std::string &name) const |
| Get the score structure by package name. More... | |
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().
1.8.4