add test
parent
876e6c830b
commit
f4185fbfe0
|
@ -35,8 +35,8 @@ julia> findnearest(s, iter, Levenshtein(); min_score = 0.9)
|
|||
(nothing, nothing)
|
||||
```
|
||||
"""
|
||||
function findnearest(s, itr, dist::StringDistance)
|
||||
min_score_atomic = Threads.Atomic{Float64}(0.0)
|
||||
function findnearest(s, itr, dist::StringDistance; min_score = 0.0)
|
||||
min_score_atomic = Threads.Atomic{Float64}(min_score)
|
||||
scores = [0.0 for _ in 1:Threads.nthreads()]
|
||||
is = [0 for _ in 1:Threads.nthreads()]
|
||||
# need collect since @threads requires a length method
|
||||
|
|
|
@ -17,7 +17,8 @@ using StringDistances, Unicode, Test
|
|||
@test compare("martha", "martha", SorensenDice(2)) ≈ 1.0 atol = 1e-4
|
||||
|
||||
# Jaro
|
||||
compare("aüa", "aua", Jaro())
|
||||
@test compare("aüa", "aua", Hamming()) ≈ 2/3
|
||||
@test compare("aüa", "aua", Jaro()) ≈ 0.77777777 atol = 1e-4
|
||||
|
||||
#Levenshtein
|
||||
compare("aüa", "aua", Levenshtein())
|
||||
|
|
Loading…
Reference in New Issue