Skip to content

Commit

Permalink
Merge pull request erlang#8557 from Maria-12648430/Maria-12648430-pat…
Browse files Browse the repository at this point in the history
…ch-1

Clarify docs for `string:jaro_similarity/2`
  • Loading branch information
dgud authored Jun 19, 2024
2 parents 0b8d3e5 + edae2df commit fd8ade6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/stdlib/src/string.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1034,11 +1034,8 @@ find(String, SearchPattern, trailing) ->
-doc """
Returns a float between `+0.0` and `1.0` representing the
[Jaro similarity](https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance)
between the given strings. Strings with many letters in common relative to their
lengths will score closer to `1.0`.
The Jaro distance between two strings can be calculated with
`JaroDistance = 1.0-JaroSimilarity`.
between the given strings. Strings with a higher similarity will score closer
to `1.0`, with `+0.0` meaning no similarity and `1.0` meaning an exact match.
_Example:_
Expand All @@ -1052,6 +1049,9 @@ _Example:_
4> string:jaro_similarity(<<"Édouard"/utf8>>, <<"Claude">>).
0.5317460317460317
```
The Jaro distance between two strings can be calculated with
`JaroDistance = 1.0 - JaroSimilarity`.
""".
-doc(#{title => <<"Functions">>,since => <<"OTP 27.0">>}).
-spec jaro_similarity(String1, String2) -> Similarity when
Expand Down

0 comments on commit fd8ade6

Please sign in to comment.