rifle 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rifle.rb +5 -2
- data/lib/rifle/version.rb +1 -1
- metadata +1 -1
data/lib/rifle.rb
CHANGED
@@ -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
|
-
|
63
|
+
|
64
|
+
urns = nil
|
64
65
|
metaphones.each do |metaphone|
|
65
66
|
new_urns = get_urns_for_metaphone(metaphone)
|
66
|
-
urns = 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
|
data/lib/rifle/version.rb
CHANGED