feat: Prefer suggesting favorite items

This commit is contained in:
Artem Chepurnoy 2024-02-17 12:40:26 +02:00
parent f7a36a5b1c
commit 84565fbcc8
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E

View File

@ -223,6 +223,11 @@ class GetSuggestionsImpl(
// if (score <= scoreThreshold) {
// return@parallelSearch null
// }
val favScore = if (cipher.favorite) {
1.1f
} else {
1f
}
val correctingScore = if (target.hints.isNotEmpty()) {
val matchingCount = target.hints
.count {
@ -233,7 +238,7 @@ class GetSuggestionsImpl(
} else {
1f
}
(score * correctingScore) to wrapper
(score * correctingScore * favScore) to wrapper
}
var avgSize = 0
var avgScore = 0f