6#include <albert/export.h>
7#include <unordered_map>
15struct ALBERT_EXPORT ItemKey
19 bool operator==(
const ItemKey&)
const =
default;
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;
60struct std::hash<
albert::ItemKey>
63 inline std::size_t operator()(
const albert::ItemKey& key)
const
64 {
return (qHash(key.extension_id) ^ (qHash(key.item_id)<< 1)); }
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.
The Albert namespace.
Definition app.h:55