Update edit.jl

compathelper/new_version/2020-10-08-17-05-17-769-1797568811
matthieugomez 2020-07-13 08:52:30 -07:00
parent 31029225c2
commit 26221a13ed
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ struct Levenshtein <: Metric end
# Return max_value + 1 if distance higher than max_value
# This makes it possible to differentiate distance equalt to max_value vs strictly higher
# This is important for find_all
function (dist::Levenshtein)(s1, s2, max_value = nothing)
function (dist::Levenshtein)(s1, s2, max_value::Union{Integer, Nothing} = nothing)
((s1 === missing) | (s2 === missing)) && return missing
s1, s2 = reorder(s1, s2)
len1, len2 = length(s1), length(s2)
@ -115,7 +115,7 @@ struct DamerauLevenshtein <: SemiMetric end
## http://blog.softwx.net/2015/01/optimizing-damerau-levenshtein_15.html
# Return max_value + 1 if distance higher than max_value
function (dist::DamerauLevenshtein)(s1, s2, max_value = nothing)
function (dist::DamerauLevenshtein)(s1, s2, max_value::Union{Integer, Nothing} = nothing)
((s1 === missing) | (s2 === missing)) && return missing
s1, s2 = reorder(s1, s2)
len1, len2 = length(s1), length(s2)