Skip to main content

simi/algo/
mod.rs

1//! ## The Algorithm Arsenal
2//!
3//! Categorized similarity algorithms, each returning a normalized `f64` score
4//! where `1.0` = identical and `0.0` = completely dissimilar.
5//!
6//! **Short Strings & Typos**
7//!
8//! | Algorithm | Best for | Time |
9//! |---|---|---|
10//! | [`levenshtein`] | Edit distance (typos) | O(n·m) |
11//! | [`jaro_winkler`] | Name matching | O(n·m) |
12//! | [`hamming`] | Equal-length strings | O(n) |
13//!
14//! **Sets & Documents**
15//!
16//! | Algorithm | Best for | Time |
17//! |---|---|---|
18//! | [`jaccard`] | N-gram set similarity | O(n+m) |
19//! | [`minhash`] | Large-document fingerprints | O(k·n) |
20//! | [`simhash`] | Deduplication fingerprints | O(n) |
21//!
22//! **Statistical Meaning**
23//!
24//! | Algorithm | Best for | Time |
25//! |---|---|---|
26//! | [`bm25`] | Search relevance ranking | O(n·m) |
27//! | [`tfidf`] | Term-weighted cosine similarity | O(n·m) |
28//!
29//! Each function in this module takes pre-processed inputs (strings) and
30//! returns an `f64` in `[0.0, 1.0]`.
31
32pub mod bm25;
33pub mod hamming;
34pub mod jaccard;
35pub mod jaro_winkler;
36pub mod levenshtein;
37pub mod minhash;
38pub mod simhash;
39pub mod tfidf;