simi/lib.rs
1//! # SIMI -- Similarity Toolkit
2//!
3//! A general-purpose toolkit of similarity checks, designed to protect
4//! developers from wasting compute and money on LLMs for simple tasks.
5//!
6//! ## Feature flags
7//!
8//! - `std` (default on) -- enables standard library integration.
9//! - `python` -- enables Python bindings via PyO3.
10//! - `nodejs` -- enables Node.js bindings via napi-rs.
11//!
12//! ## Quick start
13//!
14//! ```rust
15//! use simi::algo::{levenshtein, jaro_winkler};
16//!
17//! let d = levenshtein::similarity("kitten", "sitting");
18//! assert!((d - 0.571).abs() < 0.01);
19//!
20//! let j = jaro_winkler::similarity("MARTHA", "MARHTA");
21//! assert!((j - 0.961).abs() < 0.01);
22//! ```
23
24#![cfg_attr(not(feature = "std"), no_std)]
25
26pub mod algo;
27pub mod error;
28pub mod prelude;
29
30pub mod batch;
31pub mod preprocess;
32pub mod router;
33
34#[cfg(feature = "python")]
35pub mod python;
36
37#[cfg(feature = "nodejs")]
38pub mod nodejs;
39
40pub use algo::*;
41pub use batch::BatchComparator;
42pub use error::SimiError;
43pub use preprocess::Preprocessor;
44pub use router::{resolve_intent, Intent, SimiFlow, Strategy, Threshold};