Skip to content

Commit

Permalink
Updated readme and benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
zgornel committed Sep 26, 2018
1 parent 1417b27 commit 9257e1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ julia> using Pkg
target = randstring(10) # target string

# search for best 3 matches with distance < 10
found = find(bkt, "bbb", 10, k=3)
found = find(bkt, target, 10, k=3)
@show target, found

#(target, found) = ("3dCngHYaXy", Tuple{Float64,String}[(7.0, "9bbbmnUDOZ"), (7.0, "hbYZP7bmb5"), (7.0, "jDbjzOTbbR")])
#(target, found) = ("RIqWKU2A38", Tuple{Float64,String}[(7.0, "uIfPK02wH9"), (7.0, "RIqTF8YC6O"), (7.0, "XMqWKG1GHN")])
```

## Installation
Expand Down
4 changes: 2 additions & 2 deletions scripts/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ using Random
using StringDistances

lev(x::S,y::S) where S<:AbstractString = evaluate(Levenshtein(), x, y)
dictionary = [randstring(10) for _ in 1:500_000]
dictionary = [randstring(10) for _ in 1:10_000]
bkt = BKTree(lev, sort(dictionary))

target = randstring(10)

found = find(bkt, "bbb", 10, k=3)
@time found=find(bkt, "bbb", 10, k=3)
@time found=find(bkt, target, 10, k=3)
@show target, found
Binary file added test/_words.bin
Binary file not shown.

0 comments on commit 9257e1c

Please sign in to comment.