Combine the candidate score parts into the final ranking score.
(candidate: &CandidateScore, recency: f64)
| 193 | |
| 194 | /// Combine the candidate score parts into the final ranking score. |
| 195 | fn final_score(candidate: &CandidateScore, recency: f64) -> f64 { |
| 196 | let neighbor = if candidate.neighbor { |
| 197 | NEIGHBOR_BONUS |
| 198 | } else { |
| 199 | 0.0 |
| 200 | }; |
| 201 | candidate.base + neighbor + RECENCY_WEIGHT * recency |
| 202 | } |
| 203 | |
| 204 | fn why_matched(candidate: &CandidateScore) -> &'static str { |
| 205 | match (candidate.base > 0.0, candidate.neighbor) { |