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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85bc3854e44a981902f2fb48ba4a9a1cad40f808d537aac58fb643c821751ccf
4
- data.tar.gz: 0a58ceca1b3244204dc2b4f09c165b43a4aaf7e294dfe1877f77fb5bd255bc08
3
+ metadata.gz: 631644d571a85caa378a75c63d88055b1093e7b0d4851f4897bdea6a9dee5fa3
4
+ data.tar.gz: 2bf674fcec061661aea8bbd524673ad6363afa61bf5b29bda3dff0c82457d4d2
5
5
  SHA512:
6
- metadata.gz: 9f597170c0772cb13977b7ddb344172966bf03d93de6a6a4983abb30b9cd19aa782edf6d0a15dac402e5ec155b04809bec4f47f262ca110dc9eeda199e0e4f88
7
- data.tar.gz: edcb80e516ada4e83af1836c2af6af6e5d63bcc392356873e9c8f49439b54ccf13b0db5606a5004329affdfccf54dde6bc3926d02beccb7861d013df2f335d6a
6
+ metadata.gz: c238c368085d7d76d61ad7f53813ef6fb01d0924b9d0af13cf68ea0f040a84a4f522bc0e1b86e1f6a6556469d282860ed450f399aeaeecb6144b7bab97fa2bdc
7
+ data.tar.gz: cac190d3c1bfbd7b5d20a3d1c927938474f1b27044f5db8008a2639522f2b4a23a805ac8f7cf3e30d533a1c8203b8961ce3ffb63718df23daefd03f5cbf89d8c
@@ -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, encode_vec(vec))
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, encoded_vec)
12
+ def remove_vector(bucket, data)
13
13
  @storage[bucket] = @storage[bucket].reject do |encoded_str|
14
- encoded_str.split(":")[0] == encoded_vec
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, encoded_vec)
15
+ def remove_vector(bucket, data)
16
16
  @instance.lrange(bucket, 0, -1).each do |val|
17
- if(val.split(":")[0] == encoded_vec)
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.3
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
- rubygems_version: 3.1.2
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