Sha256: 313a0d8af2aafcbea87dd5b756b45fb5be22e5b5e14c837659365af570d37cf2

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

class Splam::Rules::GoodWords < Splam::Rule
  
  def run
    good_words = [ /I\'having a problem/, ]
    good_words |= %w( lighthouse activereload  warehouse install eclipse settings assigned user ticket tickets token api number query request)
    good_words |= %w( browser feed firefox safari skitch vendor rails action_controller railties )
    good_words |= %w( redirect login diff dreamhost setup subversion git  wildcard domain subdomain ssh database )
    good_words |= %w( project billing tags description comment milestone saving happening feature mac implement report)
    good_words |= %w( rss notification subscribe calendar chart note task gantt search service ownership application communicate )
    good_words |= %w( pattern template web integer status xml activereload html state page)
    good_words << "project management"
    good_words << "/usr/local/lib" << "gems"

    body = @body.downcase
    good_words.each { |rule| 
      add_score -5 * body.scan(rule).size, "relevant word match: #{rule}"
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
splam-0.1.1 lib/splam/rules/good_words.rb
splam-0.1.0 lib/splam/rules/good_words.rb