rifle 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/rifle.rb +5 -2
  2. data/lib/rifle/version.rb +1 -1
  3. metadata +1 -1
@@ -60,11 +60,14 @@ module Rifle
60
60
  p "Rifle searching for #{sentence}, urns only #{urns_only}"
61
61
  words = get_words_array_from_text(sentence)
62
62
  metaphones = get_metaphones_from_word_set(Set.new(words))
63
- urns = Set.new
63
+
64
+ urns = nil
64
65
  metaphones.each do |metaphone|
65
66
  new_urns = get_urns_for_metaphone(metaphone)
66
- urns = urns.merge(new_urns)
67
+ urns = urns.nil? ? Set.new(new_urns) : urns.intersection(new_urns)
67
68
  end
69
+ urns ||= Set.new
70
+
68
71
  p "Rifle found #{urns.size} urns"
69
72
  if urns_only
70
73
  urns
@@ -1,3 +1,3 @@
1
1
  module Rifle
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rifle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: