reference
parent
d52d6af1ba
commit
70e64c34e8
|
@ -43,3 +43,6 @@ StringDistances allow to compute various distances between strings. It works wit
|
|||
While the Winkler adjustment was originally defined in the context of the Jaro distance, it can be helpful with other distances too. Note: a distance is automatically normalized between 0 and 1 when used with a Winkler adjustment.
|
||||
|
||||
|
||||
## References
|
||||
A good reference for these string distances is an article written for the R package `stringdist`:
|
||||
*The stringdist Package for Approximate String Matching* Mark P.J. van der Loo
|
|
@ -22,7 +22,7 @@ end
|
|||
function evaluate{T <: QGram}(normalized::Normalized{T}, s1::AbstractString, s2::AbstractString,
|
||||
len1::Integer, len2::Integer)
|
||||
distance = evaluate(normalized.dist, s1, s2, len1, len2)
|
||||
if len1 == normalized.dist.q - 1
|
||||
len1 != (normalized.dist.q - 1) :
|
||||
return s1 == s2 ? 0.0 : 1.0
|
||||
else
|
||||
return distance / (len1 + len2 - 2 * normalized.dist.q + 2)
|
||||
|
|
Loading…
Reference in New Issue