LexisMinhash::Engine
Backward compatibility: allow Engine to accept Document interface
Constants
Default configuration constants
Class methods
Computes a MinHash signature with optional TF-IDF weights. Unknown shingles use the configured default weight (default: 1.0). Negative weights are clamped to 0 (excluded from signature).
Compute weighted signature using hashed shingle keys (UInt64).
Compute signature using rolling hash + multiply-shift. Returns Array(UInt32) for backward compatibility.
Computes a MinHash signature from a Document
Provides backward compatibility for code using the Document interface.
See LexisMinhash::Document for implementation details.
Compute weighted signature from parallel iterables of hashes and weights.
Compute signature directly from pre-hashed UInt64 values. The application handles String → UInt64 conversion.
Compute signature slice with optional String->Float64 weights.
Compute signature as Slice(UInt32) for performance-critical code.
Compute a weighted signature from String-keyed weights. Pre-hashes the weights map once to avoid repeated String allocations.
Compute weighted signature where weights are keyed by the shingle's UInt64 rolling hash.
Computes a weighted MinHash signature from String-keyed weights.
Pure signature computation using an explicit Config. Returns a Slice(UInt32). Deterministic given the same config and text.
Convenience: prehash String-keyed weights and compute signature.
Configure the engine by creating a new default_config from supplied params.
Estimate probability of detecting similar items.
Generate LSH bands from a signature (Array or Slice). Returns Array({Int32, UInt64}) with {band_index, band_hash} tuples.
Generate a Config instance. When seed is provided the coefficient
arrays a and b are filled deterministically using splitmix64 so
results are reproducible across runs. When seed is nil, uses
Random::Secure as before.
Compute true Jaccard similarity between two texts based on shingle sets.
Compute true Jaccard similarity between two Documents.
Overlap coefficient for two sorted UInt64 slices.
Overlap coefficient for two sorted UInt32 slices.
Convert String-keyed weights into UInt64-keyed weights using rolling shingle hash.
Compute the rolling UInt64 hash for a given shingle String.
Generate rolling shingle hashes (UInt64) for a text and window size k.
Yields each rolling hash without allocating shingle strings.
Generate rolling shingles with both hash and string representation. Yields (UInt64 hash, String shingle) for each shingle in the text.
Compute similarity between two signatures (Array or Slice)