All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning. Release dates are based on the Hex.pm release history.
- Replaced the historical Simhash performance claim with a packaged, reproducible benchmark script using pinned Similarity, simhash-ex, and Benchee versions.
0.5.1 - 2026-08-23
- Short-circuited identical Simhash comparisons and single-ngram binary hashes to avoid redundant hashing and bit normalization.
0.5.0 - 2026-08-23
- Added Credo 1.7.19 for strict static analysis in development and test environments.
- Added StreamData property tests for similarity invariants, Unicode n-grams, vector lengths, and cosine stream pair generation.
- Expanded the documentation and test coverage.
- Added a GitHub Actions test workflow.
- Updated ExDoc to 0.40, FastNgram to 1.3, and StreamData to 1.4.
- Raised the minimum supported Elixir version from 1.7 to 1.14 and expanded CI to cover the minimum and current Elixir/Erlang runtimes.
- Added CI checks for formatting, compiler warnings, strict Credo analysis, and 100% test coverage.
- Improved Simhash performance by accumulating hash votes in one pass and replacing expanded fixed-size bit conversions with shared conversion functions.
- Improved cosine pair comparisons by indexing attributes before matching them.
- Reduced cosine vector calculations to one numeric pass, removed intermediate sets from attribute comparisons, and made cosine streams element-lazy.
- Removed the undocumented
Similarity.Cosine.stream_next/1andSimilarity.Cosine.do_add_attributes/3implementation helpers from the public API. - Removed the unused Benchee development dependency.
- Corrected a typo in the
Similarity.Cosinemodule documentation. - Fixed
Similarity.Cosine.stream/1crashing when it contains no entries. - Fixed comparisons without shared attributes raising an arithmetic error.
- Replaced incidental errors for missing cosine entry IDs with a clear
ArgumentError. - Added explicit errors for unequal-length and zero-magnitude cosine vectors.
- Added consistent Simhash validation for n-gram sizes, hash functions, and return types.
- Applied Sørensen–Dice length validation consistently to identical strings.
- Rejected explicit invalid Simhash option values, validated Sørensen–Dice n-gram sizes, and added clear unequal-length errors to dot-product and Hamming helpers.
0.4.0 - 2022-12-29
- Added configurable
:siphash,:md5, and:sha256hash functions for Simhash. - Added the
:binaryreturn type toSimilarity.Simhash.hash/2.
- Changed
Similarity.Simhash.hashto accept:ngram_size,:hash_function, and:return_typeas keyword options.
0.3.0 - 2022-12-28
- Replaced the
:integerSimhash return type with explicit:int64_unsignedand:int64_signedreturn types.
0.2.4 - 2022-12-27
- Added an
ArgumentErrorwhen either string passed to the Sorensen-Dice implementation is shorter than the configured n-gram size.
0.2.3 - 2022-12-27
- Added Sorensen-Dice similarity for strings, lists, and
MapSetvalues throughSimilarity.SorensenDiceandSimilarity.sorensen_dice/3.
0.2.2 - 2022-12-27
- Added an integer return type to
Similarity.Simhash.hashwhile retaining the list-of-bits return type. - Added an
ArgumentErrorwhen a string passed to Simhash is shorter than the configured n-gram size.
- Updated project dependencies and added Benchee as a development dependency.
0.2.1 - 2020-05-22
- Fixed Simhash binary-to-integer conversion so the result is always 64 bits.
0.2.0 - 2019-10-15
- Added Simhash string similarity and hash generation using character n-grams and SipHash.
- Added Simhash tests, documentation, and benchmark results.
0.1.0 - 2019-06-18
- Initial release.
- Added cosine similarity, cosine similarity scaled by the square root of vector length, Euclidean dot product, and Euclidean magnitude calculations.
- Added
Similarity.Cosinefor accumulating IDs and their attributes, comparing entries, and streaming all unique similarity pairs.