anngler 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/anngler/index.rb +2 -2
- data/lib/anngler/storage/memory_backend.rb +2 -2
- data/lib/anngler/storage/redis_backend.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 631644d571a85caa378a75c63d88055b1093e7b0d4851f4897bdea6a9dee5fa3
|
4
|
+
data.tar.gz: 2bf674fcec061661aea8bbd524673ad6363afa61bf5b29bda3dff0c82457d4d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c238c368085d7d76d61ad7f53813ef6fb01d0924b9d0af13cf68ea0f040a84a4f522bc0e1b86e1f6a6556469d282860ed450f399aeaeecb6144b7bab97fa2bdc
|
7
|
+
data.tar.gz: cac190d3c1bfbd7b5d20a3d1c927938474f1b27044f5db8008a2639522f2b4a23a805ac8f7cf3e30d533a1c8203b8961ce3ffb63718df23daefd03f5cbf89d8c
|
data/lib/anngler/index.rb
CHANGED
@@ -61,13 +61,13 @@ module Anngler
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
def remove(vec)
|
64
|
+
def remove(vec, label: "")
|
65
65
|
hashes = calc_hashes(vec)
|
66
66
|
|
67
67
|
#remove vector from each tree
|
68
68
|
hashes.each_with_index do |hash, i|
|
69
69
|
bucket = "#{@bucket_name}:#{i}:#{hash2string(hash)}"
|
70
|
-
@storage.remove_vector(bucket,
|
70
|
+
@storage.remove_vector(bucket, pack_data(vec, label))
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -9,9 +9,9 @@ module Anngler
|
|
9
9
|
@storage[bucket] = [data] + @storage[bucket]
|
10
10
|
end
|
11
11
|
|
12
|
-
def remove_vector(bucket,
|
12
|
+
def remove_vector(bucket, data)
|
13
13
|
@storage[bucket] = @storage[bucket].reject do |encoded_str|
|
14
|
-
encoded_str
|
14
|
+
encoded_str == data
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -12,9 +12,9 @@ module Anngler
|
|
12
12
|
@instance.lpush(bucket, data)
|
13
13
|
end
|
14
14
|
|
15
|
-
def remove_vector(bucket,
|
15
|
+
def remove_vector(bucket, data)
|
16
16
|
@instance.lrange(bucket, 0, -1).each do |val|
|
17
|
-
if(val
|
17
|
+
if(val == data)
|
18
18
|
@instance.lrem(bucket, 0, val)
|
19
19
|
return
|
20
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anngler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aiden Leeming
|
@@ -151,7 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
|
-
|
154
|
+
rubyforge_project:
|
155
|
+
rubygems_version: 2.7.8
|
155
156
|
signing_key:
|
156
157
|
specification_version: 4
|
157
158
|
summary: Anngler is an approximate nearest neighbor search for points in n-dimensional
|