Repository navigation
Added:
DamerauLevenshtein.distancenow accepts an optional maximum boundDamerauLevenshtein.most_similarconvenience method
Changed:
- Jaro has a fast path for short strings (<= 64 chars)
- Damerau-Levenshtein and Restricted Edit track min cost for early termination
- Damerau-Levenshtein pre-allocates a row pool
- Damerau-Levenshtein merges row_history and matrix into a row map
- Restricted Edit has a fast path for Unicode strings, with a flat buffer, prefix/suffix stripping, and split row-0
- Avoid allocating a slice in
most_similarby iterating over indices directly - Damerau-Levenshtein has a fast path for ASCII with array-index lookups
- Hamming uses a mutable local rather than reduce
- Uses
bytesize == sizerather thansingle_byte_optimizable? - Raised minimum Crystal to 1.0.0
- Improved type annotations
- Various readability/quality improvements
- Extended tests
Fixed:
nilis now assigned rather thanNilin RestrictedEdit
Performance
- Damerau-Levenshtein: +140% faster, −60% memory (ASCII); +25% faster, −30% memory (Unicode)
- Jaro / Jaro-Winkler: +55% faster, near-zero allocations (ASCII); +25% faster, −15% memory (Unicode)
- Hamming: +30% faster, near-zero allocations
- Restricted Edit bounded distance: +10–40% faster depending on max value; −15% memory across all variants
- Restricted Edit Unicode: +5% faster, −10% memory