-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
203 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using SimString | ||
using Faker | ||
using BenchmarkTools | ||
using DataStructures | ||
|
||
################################# Benchmark Bulk addition ##################### | ||
db = DictDB(CharacterNGrams(3, " ")); | ||
Faker.seed(2020) | ||
@time fake_names = [string(Faker.first_name(), " ", Faker.last_name()) for i in 1:100_000]; | ||
|
||
|
||
f(d, x) = append!(d, x) | ||
@time f(db, fake_names) | ||
|
||
|
||
|
||
################################ Simple Addition ############################### | ||
|
||
db = DictDB(CharacterNGrams(2, " ")); | ||
push!(db, "foo"); | ||
push!(db, "bar"); | ||
push!(db, "fooo"); | ||
|
||
f(x, c, s, a, r) = search(x, c, s; α=a, ranked=r) | ||
test = "foo"; | ||
col = db; | ||
sim = Cosine(); | ||
a = 0.8; | ||
r = true; | ||
|
||
f(Cosine(), db, "foo", 0.8, true) | ||
|
||
@btime f($sim, $col, $test, $a, $r) | ||
@btime search(Cosine(), db, "foo"; α=0.8, ranked=true) | ||
|
||
|
||
|
||
db2 = DictDB(CharacterNGrams(3, " ")); | ||
append!(db2, ["foo", "bar", "fooo", "foor"]) # also works via multiple dispatch on a vector | ||
|
||
results = search(Cosine(), db, "foo"; α=0.8, ranked=true) # yet to be implemented | ||
|
||
bs = ["foo", "bar", "foo", "foo", "bar"] | ||
SimString.extract_features(CharacterNGrams(3, " "), "prepress") | ||
SimString.extract_features(WordNGrams(2, " ", " "), "You are a really really really cool dude.") | ||
|
||
db = DictDB(WordNGrams(2, " ", " ")) | ||
push!(db, "You are a really really really cool dude.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
You are a really really really cool dude. | ||
Sometimes you are not really really cool tho |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
foo | ||
bar | ||
fooo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f822944
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
f822944
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/54345
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: