3 unstable releases

0.2.1 Oct 13, 2020
0.2.0 Oct 13, 2020
0.1.0 Oct 11, 2020

#1435 in Text processing

Download history 1/week @ 2024-02-18 26/week @ 2024-02-25 1/week @ 2024-03-03 8/week @ 2024-03-10 13/week @ 2024-03-24 107/week @ 2024-03-31

128 downloads per month

GPL-3.0 license

15KB
75 lines

Gestalt Pattern Matching

This crate provides a single function, gestalt_ratio, which computes the gestalt pattern matching ratio between two strings, based on recursively looking at longest common substrings. The algorithm is described here: https://en.wikipedia.org/wiki/Gestalt_Pattern_Matching , and was originally described by John W. Ratcliff and John A. Obershelp in Dr. Dobbs Journal in 1988.

This metric is intended to show strings which "look similar" as more similar.

This crate was written by Alex Sanchez-Stern


lib.rs:

Ratcliff-Obershelp String Matching

Ratcliff-Obershelp String Matching, otherwise known as Gestalt Pattern Matching. This crate contains a single function, which computes a similarity score between two strings, based on recursively looking at longest common substrings. The algorithm is described in this wikipedia page: https://en.wikipedia.org/wiki/Gestalt_Pattern_Matching

Unicode Support

As of version 0.2.0 this crate supports unicode strings. Strings are compared using their extended graphemes, as provided by the unicode_segmentation crate.

Dependencies

~555KB