| 309 | } |
| 310 | |
| 311 | double LocalityScorer::GetSimilarity(QueryVec & qv, IdfMap & docIdfs, vector<DocVec> & dvc) const |
| 312 | { |
| 313 | double constexpr kScale = 1e6; |
| 314 | |
| 315 | double similarity = 0; |
| 316 | for (auto & dv : dvc) |
| 317 | similarity = max(similarity, qv.Similarity(docIdfs, dv)); |
| 318 | |
| 319 | // We need to scale similarity here to prevent floating-point |
| 320 | // artifacts, and to make sorting by similarity more robust, as 1e-6 |
| 321 | // is good enough for our purposes. |
| 322 | return round(similarity * kScale); |
| 323 | } |
| 324 | |
| 325 | string DebugPrint(LocalityScorer::ExLocality const & el) |
| 326 | { |
nothing calls this directly
no test coverage detected