Repository navigation
Summary
v0.5.0 is a minor release that adds the algorithms requested in #31, with Rust cores, PyO3 bindings, tests and README documentation. There are no breaking changes to existing APIs.
New algorithms
Token / set based
Tversky— generalized Jaccard/Dice index over k-shingle sets, withalpha/betaweights (asymmetric when they differ).Tanimoto— standard Tanimoto similarity over shingle sets (equivalent to Jaccard).Bag— character-multiset distance, a metric and cheap filter for edit distance.MongeElkan— token-based Monge-Elkan similarity with Jaro-Winkler or normalized Levenshtein as the inner measure, optional symmetric mode.
Edit / sequence based
MLIPNS— binary product-name matching heuristic.Strcmp95— US Census Jaro-Winkler variant with phonetic/OCR confusion-table partial credit.RatcliffObershelp— Gestalt pattern matching with difflib-compatible tie-breaking.
Sequence alignment
NeedlemanWunsch— global alignment, linear gap.SmithWaterman— local alignment (score is the maximum matrix cell).Gotoh— global alignment with affine gap penalties.
All three expose score() and alignment() (match/substitute/insert/delete paths).
Compression
NormalizedCompressionDistance— NCD with a pure-Rust RLE compressor.
Behaviour notes
- Tversky uses set semantics, not TextDistance's multisets.
- Tanimoto follows the standard Jaccard definition, not TextDistance's
log2variant. - Ratcliff-Obershelp follows
difflibtie-breaking and can be asymmetric on repeated patterns. - Monge-Elkan uses the standard formula; TextDistance's multi-token implementation divides by
|A|^2. - Alignment classes return raw scores, which may be negative; there is no synthetic distance.
- NCD ships only the RLE compressor, values are compressor-dependent, and identical inputs are not guaranteed to score 0.
See the README section Semantics, limitations and divergences for details.
Full Changelog: v0.4.4...v0.5.0