Skip to content

vox-similarity API Reference (generated)

Crate: vox-similarity · Version: 0.6.0 · Target: Library (lib.rs)

Pure simhash/minhash/LSH near-duplicate similarity core for Vox discovery and marketplace dedup.

Pure near-duplicate similarity core: simhash + minhash signatures, an LSH band index, clustering, and one-vs-many overlap. No filesystem, DB, or network.

ModuleDescription
fragment—
index—
signature—
Dependency Topology, diagram 13 nodes, 2 edges: vox-orchestrator-mcp → vox-similarity; vox-skill-discovery → vox-similarityvox-similarityvox-orchestrator-mcpvox-skill-discovery
Diagram source
graph {
direction: right
node vox_similarity: "vox-similarity"
node vox_orchestrator_mcp: "vox-orchestrator-mcp"
vox_orchestrator_mcp -> vox_similarity
node vox_skill_discovery: "vox-skill-discovery"
vox_skill_discovery -> vox_similarity
}
Consumer CrateRole
vox-orchestrator-mcpDirect workspace dependent
vox-skill-discoveryDirect workspace dependent
KindSymbolSignatureSourceDescription
enumfragment::FragmentKindpub enum FragmentKindcrates/vox-similarity/src/fragment.rs#L10-L16What kind of thing a fragment represents.
structfragment::Fragmentpub struct Fragmentcrates/vox-similarity/src/fragment.rs#L20-L29A normalized comparable unit.
fnfragment::newpub fn new(crates/vox-similarity/src/fragment.rs#L32—
structindex::Matchpub struct Matchcrates/vox-similarity/src/index.rs#L11-L14A confirmed near-duplicate match for a query fragment.
structindex::Clusterpub struct Clustercrates/vox-similarity/src/index.rs#L18-L20A group of mutually-similar fragments.
structindex::LshIndexpub struct LshIndexcrates/vox-similarity/src/index.rs#L24-L29Banded LSH index. bands * rows must equal the minhash length used by inserted fragments for full banding; shorter signatures are clamped.
fnindex::newpub fn new(bands: usize, rows: usize) -> Selfcrates/vox-similarity/src/index.rs#L32-L39—
fnindex::insertpub fn insert(&mut self, fragment: Fragment) -> usizecrates/vox-similarity/src/index.rs#L60-L67—
fnindex::lenpub fn len(&self) -> usizecrates/vox-similarity/src/index.rs#L69-L71—
fnindex::is_emptypub fn is_empty(&self) -> boolcrates/vox-similarity/src/index.rs#L73-L75—
fnindex::fragmentpub fn fragment(&self, idx: usize) -> &Fragmentcrates/vox-similarity/src/index.rs#L77-L79—
fnindex::overlappub fn overlap(&self, query: &Fragment, min_jaccard: f32) -> Vec<Match>crates/vox-similarity/src/index.rs#L95-L116Confirmed matches for an external query fragment. Excludes any indexed fragment that shares the query’s content hash AND source_ref (self).
fnindex::clusterpub fn cluster(&self, min_members: usize, min_jaccard: f32) -> Vec<Cluster>crates/vox-similarity/src/index.rs#L135-L179Group indexed fragments into clusters via union-find over confirmed neighbor pairs. Returns only clusters with >= min_members.
fnsignature::tokenizepub fn tokenize(text: &str) -> Vec<String>crates/vox-similarity/src/signature.rs#L6-L11Split text into lowercase alphanumeric/underscore tokens.
fnsignature::shinglepub fn shingle(text: &str, k: usize) -> Vec<String>crates/vox-similarity/src/signature.rs#L15-L24k-token shingles (sliding windows). Falls back to a single joined token when the token count is below k. Empty input yields an empty vec.
fnsignature::simhash64pub fn simhash64(shingles: &[String]) -> u64crates/vox-similarity/src/signature.rs#L27-L4764-bit SimHash over shingles (blake3 of each shingle → per-bit vote).
fnsignature::minhashpub fn minhash(shingles: &[String], num_hashes: usize) -> Vec<u32>crates/vox-similarity/src/signature.rs#L50-L65MinHash with num_hashes independent blake3-seeded hash functions.
fnsignature::hammingpub fn hamming(a: u64, b: u64) -> u32crates/vox-similarity/src/signature.rs#L68-L70Hamming distance between two 64-bit simhashes.
fnsignature::jaccard_estimatepub fn jaccard_estimate(a: &[u32], b: &[u32]) -> f32crates/vox-similarity/src/signature.rs#L73-L79Estimated Jaccard similarity from two equal-length minhash vectors.
structsignature::Signaturepub struct Signaturecrates/vox-similarity/src/signature.rs#L83-L86A deterministic similarity signature for a piece of text.
fnsignature::from_textpub fn from_text(text: &str, k: usize, num_hashes: usize) -> Selfcrates/vox-similarity/src/signature.rs#L89-L95—