Sha256: c2e4a87efb2317e5343df33ab4eadda3016b770973b5561710ca41c2dc22804d

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

# encoding: utf-8
class Splam::Rules::Russian < Splam::Rule

  def run
    banned_words =[ # various russian characters
      "\320\241", "\320\220", "\320\234", "\320\257", "\320\233", "\320\243",
      "с", "м", "о", "т", "р", "е", "т", "ь", "п", "о", "р", "н", "о", "р", "л", "и", "к"
      # unicode char
#      "\320"
    ]
    banned_words.each do |word|
      hits = (3 * @body.scan("#{word}").size) # 1 point for every banned word
      add_score hits, "Suspicious character '#{word}'"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
splam-0.1.1 lib/splam/rules/russian.rb