6#include <albert/export.h>
7#include <unordered_map>
36 void modifyMatchScores(
const QString &extension_id, std::vector<albert::RankItem> &rank_items)
const;
52 std::shared_ptr<const std::unordered_map<ItemKey, double>>
usage_scores;
Modifies match scores according to user usage history and preferences.
Definition usagescoring.h:29
double modifiedMatchScore(const ItemKey &key, double match_score) const
Returns the modified match_score for an item identified by key.
double memory_decay
The exponential decay applied to usage scores based on recency.
Definition usagescoring.h:49
std::shared_ptr< const std::unordered_map< ItemKey, double > > usage_scores
The usage scores.
Definition usagescoring.h:52
bool prioritize_perfect_match
If true perfect matches should be prioritized even if their usage score is lower.
Definition usagescoring.h:39
void modifyMatchScores(const QString &extension_id, std::vector< albert::RankItem > &rank_items) const
Modifies the match score of rank_item for an item identified by key in-place.
Definition usagescoring.h:16
QString item_id
Definition usagescoring.h:18
QString extension_id
Definition usagescoring.h:17
bool operator==(const ItemKey &) const =default
std::size_t operator()(const albert::ItemKey &key) const
Definition usagescoring.h:63