pull/40/head^2
matthieugomez 2020-11-10 07:29:48 -08:00
parent 876e6c830b
commit f4185fbfe0
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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())