evaluate
parent
d80fa324f6
commit
0f6c814b26
|
@ -36,6 +36,8 @@ compare(Hamming(), "martha", "marhta")
|
|||
compare(QGram(2), "martha", "marhta")
|
||||
#> 0.4
|
||||
```
|
||||
|
||||
To return the *litteral distance* between two strings, use `evaluate`
|
||||
## Modifiers
|
||||
|
||||
The package includes distance modifiers:
|
||||
|
@ -88,6 +90,7 @@ The package includes distance modifiers:
|
|||
|
||||
|
||||
- [TokenMax](http://chairnerd.seatgeek.com/fuzzywuzzy-fuzzy-string-matching-in-python/) combines scores using the base distance, the `Partial`, `TokenSort` and `TokenSet` modifiers, with penalty terms depending on string lengths.
|
||||
|
||||
```julia
|
||||
compare(TokenMax(RatcliffObershelp()),"mariners vs angels", "los angeles angels at seattle mariners")
|
||||
#> 0.855
|
||||
|
|
|
@ -58,16 +58,3 @@ function evaluate(dist::RatcliffObershelp, s1::AbstractString, s2::AbstractStrin
|
|||
end
|
||||
1.0 - 2 * matched / (len1 + len2)
|
||||
end
|
||||
|
||||
#function buildref(s::AbstractString, len)
|
||||
# ref = Array(Int, len)
|
||||
# state = start(s)
|
||||
# i = 0
|
||||
# while !done(s, state)
|
||||
# i += 1
|
||||
# ref[i] = state
|
||||
# ch, state = next(s, state)
|
||||
# end
|
||||
# return ref
|
||||
#end
|
||||
|
||||
|
|
Loading…
Reference in New Issue