# Crate strsim [−] [src]

This library implements string similarity metrics. Currently includes Hamming, Levenshtein, Jaro, and Jaro-Winkler.

## Enums

StrSimError |

## Functions

damerau_levenshtein | Same as Levenshtein but allows for adjacent transpositions.
damerau_levenshtein_against_vec | Calculates the Damerau-Levenshtein distance between a string and each string in a vector. Returns a vector of corresponding values.
hamming | Calculates the number of positions in the two strings where the characters differ. Returns an error if the strings have different lengths.
jaro | Calculates the Jaro similarity between two strings. The returned value is between 0.0 and 1.0 (higher value means more similar).
jaro_against_vec | Calculates the Jaro distance between a string and each string in a vector. Returns a vector of corresponding values between 0.0 and 1.0 (higher value means more similar).
jaro_winkler | Like Jaro but gives a boost to strings that have a common prefix.
jaro_winkler_against_vec | Calculates the Jaro-Winkler distances between a string and each string in a vector. Returns a vector of corresponding values.
levenshtein | Calculates the minimum number of insertions, deletions, and substitutions required to change one string into the other.
levenshtein_against_vec | Calculates the Levenshtein distance between a string and each string in a vector. Returns a vector of corresponding values.

## Type Definitions

HammingResult |

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)