lsh 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,7 @@ module LSH
49
49
  end
50
50
 
51
51
  def number_of_buckets
52
- @redis.get("buckets") || 0
52
+ @redis.get("buckets").to_i || 0
53
53
  end
54
54
 
55
55
  def projections=(projections)
@@ -117,6 +117,8 @@ module LSH
117
117
  bucket = find_bucket(i)
118
118
  vector_hashes += @redis.smembers("#{bucket}:#{hash}")
119
119
  end
120
+ # Making sure we don't load the same vectors twice if they match
121
+ # in different random projections
120
122
  vector_hashes.uniq!
121
123
  results = []
122
124
  vector_hashes.each do |vector_hash|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-31 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gsl