pub struct MinHash {
pub sig: [u64; 128],
pub bands: [u64; 32],
pub shingle_count: usize,
}Expand description
A MinHash signature plus its LSH band hashes.
Fields§
§sig: [u64; 128]§bands: [u64; 32]§shingle_count: usizeImplementations§
Source§impl MinHash
impl MinHash
Sourcepub fn from_signature(sig: [u64; 128]) -> Self
pub fn from_signature(sig: [u64; 128]) -> Self
Rehydrate a MinHash from a stored 128-value signature, recomputing the
LSH bands. shingle_count is unknown from the signature alone and is set
to zero; it does not affect jaccard or
shares_band.
Sourcepub fn jaccard(&self, other: &Self) -> f64
pub fn jaccard(&self, other: &Self) -> f64
Estimated Jaccard similarity: the fraction of equal signature positions.
Whether the two texts share at least one LSH band (candidate for match).
Sourcepub fn matches(&self, other: &Self) -> bool
pub fn matches(&self, other: &Self) -> bool
Whether the two texts are the same or overlapping content
(estimated Jaccard >= MATCH_JACCARD).
Trait Implementations§
impl Eq for MinHash
impl StructuralPartialEq for MinHash
Auto Trait Implementations§
impl Freeze for MinHash
impl RefUnwindSafe for MinHash
impl Send for MinHash
impl Sync for MinHash
impl Unpin for MinHash
impl UnsafeUnpin for MinHash
impl UnwindSafe for MinHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more