pub struct SimHash64(pub u64);Expand description
A 64-bit SimHash fingerprint.
Tuple Fields§
§0: u64Implementations§
Source§impl SimHash64
impl SimHash64
pub fn from_features(features: &[WeightedFeature]) -> Self
pub fn from_features_with_options( features: &[WeightedFeature], options: SimHashOptions, ) -> Self
pub fn from_feature_hashes<I>(hashes: I) -> Selfwhere
I: IntoIterator<Item = FeatureHash>,
pub fn from_feature_hashes_with_options<I>(
hashes: I,
options: SimHashOptions,
) -> Selfwhere
I: IntoIterator<Item = FeatureHash>,
Sourcepub fn from_hashes_unweighted_fast(hashes: &[u64]) -> Self
pub fn from_hashes_unweighted_fast(hashes: &[u64]) -> Self
Fast unweighted SimHash over pre-hashed elements.
This uses the byte-lane counter trick described by Otmar Ertl’s
FastSimHash article: each byte lane in a u64 counts one bit position,
then lanes are flushed before they can overflow. The result is equivalent
to the normal unweighted SimHash path.
pub fn from_hashes_unweighted_fast_with_options( hashes: &[u64], options: SimHashOptions, ) -> Self
pub fn from_text(text: &str, extractor: &WebFeatureExtractor) -> Self
pub fn from_html(html: &str, extractor: &WebFeatureExtractor) -> Self
pub fn hamming_distance(self, other: Self) -> u32
pub fn similarity(self, other: Self) -> f64
pub fn is_near_duplicate(self, other: Self, max_distance: u32) -> bool
Trait Implementations§
impl Copy for SimHash64
impl Eq for SimHash64
Source§impl Ord for SimHash64
impl Ord for SimHash64
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for SimHash64
impl PartialOrd for SimHash64
impl StructuralPartialEq for SimHash64
Auto Trait Implementations§
impl Freeze for SimHash64
impl RefUnwindSafe for SimHash64
impl Send for SimHash64
impl Sync for SimHash64
impl Unpin for SimHash64
impl UnsafeUnpin for SimHash64
impl UnwindSafe for SimHash64
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