gestalt_ratio#
- minim.utility.gestalt_ratio(reference: str, strings: str | list[str]) float | list[float] | ndarray[float] [source]#
Compute the Gestalt or Ratcliff–Obershelp ratios, a measure of similarity, for strings with respect to a reference string.
- Parameters:
- referencestr
Reference string.
- stringsstr or list
Strings to compare with reference.
- Returns:
- ratiosfloat, list, or numpy.ndarray
Gestalt or Ratcliff–Obershelp ratios. If strings is a str, a float is returned. If strings is a list, a numpy.ndarray is returned if NumPy is installed; otherwise, a list is returned.