The algorithm pages explain how each measure works. These guides cover the decisions around them: which measure to reach for, what the numbers mean when implementations disagree, and where the time and memory go.
Choosing an algorithm
Start from the task, then narrow the choice by output type, normalization and metric status.
Semantics and divergences
Read the deliberate differences from TextDistance and other implementations, measure by measure.
Performance
Review complexity and memory by family, profile reuse, and Unicode code-point semantics.
What these guides assume
- The examples target
strsimpy0.5.0 on Python 3.10 or newer. - Classes are imported from the package root. The historical per-module imports,
such as
from strsimpy.levenshtein import Levenshtein, also work. - Outputs shown in comments and result blocks were produced by 0.5.0. Floating point values are printed at full precision, so some are mathematically exact fractions and some are their nearest binary representations.
A quick map
| If you need to… | Read… |
|---|---|
| Pick a measure for typo correction, edit counts, set similarity, tokens, alignment, compression or diff-style matching | Choosing an algorithm |
| Understand why a score differs from TextDistance, or what a negative alignment score or a non-zero identical-string NCD means | Semantics and divergences |
Decide between score() and alignment(), cache shingle profiles, or reason about Unicode length |
Performance |
| Look up a constructor, return type, ABC or pickle guarantee | API reference |
| See what changed in the current release | Changelog |
Related reference
- API reference lists every public class, its module, constructor defaults, methods, return types, ABC registrations and pickle support.
- Changelog summarizes the 0.5.0 release and points to the full GitHub release history.