library for fast approximate string matching using Jaro and Jaro-Winkler similarity
pip install jarowinklerJaroWinkler
JaroWinkler is a library to calculate the Jaro and Jaro-Winkler similarity. It is easy to use, is far more performant than all alternatives and is designed to integrate seemingless with RapidFuzz.
:zap: Quickstart
>>> from jarowinkler import *
>>> jaro_similarity("Johnathan", "Jonathan")
0.8796296296296297
>>> jarowinkler_similarity("Johnathan", "Jonathan")
0.9037037037037037
🚀 Benchmarks
The implementation is based on a novel approach to calculate the Jaro-Winkler similarity using bitparallelism. This is significantly faster than the original approach used in other libraries. The following benchmark shows the performance difference to jellyfish and python-Levenshtein.
⚙️ Installation
You can install this library from PyPI with pip:
pip install jarowinkler
JaroWinkler provides binary wheels for all common platforms.
Source builds
For a source build (for example from a SDist packaged) you only require a C++14 compatible compiler. You can install directly from GitHub if you would like.
pip install git+https://github.com/maxbachmann/JaroWinkler.git@main
📖 Usage
Any algorithms in JaroWinkler can not only be used with strings, but with any arbitary sequences of hashable objects:
from jarowinkler import jarowinkler_similarity
jarowinkler_similarity("this is an example".split(), ["this", "is", "a", "example"])
# 0.8666666666666667