using StringDistances
function CLD(a,b)
result=fill(0.0,size(b,1))
for p=1:size(a,1)
result[p]=compare(a[p,:][],b[p,:][],DamerauLevenshtein())
end
return result
end
A=rand(5,3);
B=rand(5,3)
julia> CLD(A[1,:],B[1,:])
3-element Array{Float64,1}:
0.0
0.0
0.0
All is OK , but:
julia> map(+,A[1,:],B[1,:])
3-element Array{Float64,1}:
1.5078756063214551
0.9446955888815904
1.5179640101430865
julia> map(CLD,A[1,:],B[1,:])
ERROR: MethodError: no method matching getindex(::Float64, ::Int64, ::Colon)
Closest candidates are:
getindex(::Number, ::Integer) at number.jl:76
getindex(::Number, ::Integer...) at number.jl:81
getindex(::Number) at number.jl:75