Skip to content

0.9.0

Latest

Choose a tag to compare

@tcrouch tcrouch released this 01 Mar 20:32

Added:

  • DamerauLevenshtein.distance now accepts an optional maximum bound
  • DamerauLevenshtein.most_similar convenience 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_similar by 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 == size rather than single_byte_optimizable?
  • Raised minimum Crystal to 1.0.0
  • Improved type annotations
  • Various readability/quality improvements
  • Extended tests

Fixed:

  • nil is now assigned rather than Nil in 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