Introduce a function to ignore useless paths

This commit is contained in:
Kerollmops
2020-06-13 00:17:43 +02:00
parent d02c5cb023
commit b9cc6c10af
2 changed files with 30 additions and 17 deletions

View File

@ -119,7 +119,7 @@ impl Index {
let mut documents = Vec::new();
for (proximity, mut positions) in BestProximity::new(positions) {
for (proximity, mut positions) in BestProximity::new(positions, |_, _| true) {
// TODO we must ignore positions paths that gives nothing
if (proximity as usize) < words.len() - 1 {
eprintln!("Skipping too short proximities of {}.", proximity);