pub fn query(&mut self, min_hash: &MinHash) -> Result<HashSet<KeyType>> {
        if min_hash.hash_values.0.len() != self.num_perm {
            return Err(MinHashingError::DifferentNumPermFuncs);
        }
        let unique_candidates = self
            .hash_ranges
            .iter()
            .zip(&self.hash_tables)
            .flat_map(|(range, table)| {
                let (start, end) = range;
                let hash_part = min_hash.hash_values.0[*start..*end].to_owned();
                table.get(&HashValuePart(hash_part))
            })
            .flatten()
            .cloned()
            .collect();
        Ok(unique_candidates)
    }
/// Query for candidates potentially within a jaccard-distance corresponding to the configured
/// threshold
Query for candidates potentially within a jaccard-distance corresponding to the configured
threshold
Query for candidates potentially within a jaccard - distance corresponding to the configured threshold
pub fn query(&mut self, min_hash: &MinHash) -> Result<HashSet<KeyType>> {
        if min_hash.hash_values.0.len() != self.num_perm {
            return Err(MinHashingError::DifferentNumPermFuncs);
        }
        let unique_candidates = self
            .hash_ranges
            .iter()
            .zip(&self.hash_tables)
            .flat_map(|(range, table)| {
                let (start, end) = range;
                let hash_part = min_hash.hash_values.0[*start..*end].to_owned();
                table.get(&HashValuePart(hash_part))
            })
            .flatten()
            .cloned()
            .collect();
        Ok(unique_candidates)
    }
pub fn query ( & mut self , min_hash : & MinHash ) -> Result < HashSet < KeyType > > { if min_hash . hash_values . 0 . len ( ) != self . num_perm { return Err ( MinHashingError :: DifferentNumPermFuncs ) ; } let unique_candidates = self . hash_ranges . iter ( ) . zip ( & self . hash_tables ) . flat_map ( | ( range , table ) | { let ( start , end ) = range ; let hash_part = min_hash . hash_values . 0 [ * start .. * end ] . to_owned ( ) ; table . get ( & HashValuePart ( hash_part ) ) } ) . flatten ( ) . cloned ( ) . collect ( ) ; Ok ( unique_candidates ) }
Query for candidates potentially within a jaccard-distance corresponding to the configured
threshold
Query for candidates potentially within a jaccard - distance corresponding to the configured threshold
&mut self
min_hash
&MinHash
&mut self
min_hash
&MinHash