compare
parent
df30879199
commit
ba885cb4b8
12
README.md
12
README.md
|
@ -26,18 +26,8 @@ Q-gram distances compare the set of all substrings of length `q` in each string.
|
|||
- [RatcliffObershelp Distance](https://xlinux.nist.gov/dads/HTML/ratcliffObershelp.html)
|
||||
|
||||
## Syntax
|
||||
#### evaluate
|
||||
The function `evaluate` returns the litteral *distance* between two strings (a value of 0 being identical). While some distances are bounded by 1, other distances like `Hamming`, `Levenshtein`, `Damerau-Levenshtein`, `Jaccard` can be higher than 1.
|
||||
```julia
|
||||
using StringDistances
|
||||
evaluate(Hamming(), "martha", "marhta")
|
||||
#> 2
|
||||
evaluate(QGram(2), "martha", "marhta")
|
||||
#> 6
|
||||
```
|
||||
|
||||
#### compare
|
||||
The higher level function `compare` returns *a similarity score* between two strings. The similarity score is always between 0 and 1. A value of 0 being completely different and a value of 1 being completely similar.
|
||||
The function `compare` returns *a similarity score* between two strings (based on the inverse of the distance). The similarity score is always between 0 and 1. A value of 0 being completely different and a value of 1 being completely similar.
|
||||
```julia
|
||||
using StringDistances
|
||||
compare(Hamming(), "martha", "marhta")
|
||||
|
|
Loading…
Reference in New Issue