Permalink
Browse files

After some thought, we need to reject stop words at match time also..

  • Loading branch information...
1 parent 560192e commit 733389e5d9a4e82736511d504fe7b5af261e42b9 @erwaller erwaller committed Jan 5, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/soulmate/matcher.rb
View
4 lib/soulmate/matcher.rb
@@ -5,7 +5,9 @@ class Matcher < Base
def matches_for_term(term, options = {})
options = { :limit => 5, :cache => true }.merge(options)
- words = normalize(term).split(' ').reject{ |w| w.size < MIN_COMPLETE }.sort
+ words = normalize(term).split(' ').reject do |w|
+ w.size < MIN_COMPLETE or Soulmate.stop_words.include?(w)
+ end.sort
return [] if words.empty?

0 comments on commit 733389e

Please sign in to comment.