lib/banhammer.rb
####
# Returns an integer representing the total spam score found within the body, 0 if no spam is found.
# 	:high sensitivity - matches words within words or partial words. 
# 	default sensitivity - matches to whole words only.
####
Returns an integer representing the total spam score found within the body, 0 if no spam is found.
Returns an integer representing the total spam score found within the body 0 if no spam is found .
def check_keywords(body)
      body.downcase!
      score = 0
      if @keyword_sensitivity_level == :high
        @keyword_filter_list.each { |f| if body.include?(f) then body.gsub(/#{f}/) { |x| score += @default_spam_point } end }
      else
        @keyword_filter_list.each { |f| if body.match(/\s#{f}\s/) then body.gsub(/\s#{f}\s/) { |x| score += @default_spam_point } end }
      end
      score
    end
def check_keywords ( body ) body . downcase! score = 0 if @keyword_sensitivity_level == :high @keyword_filter_list . each { | f | if body . include? ( f ) then body . gsub ( / #{ f } / ) { | x | score += @default_spam_point } end } else @keyword_filter_list . each { | f | if body . match ( / \s #{ f } \s / ) then body . gsub ( / \s #{ f } \s / ) { | x | score += @default_spam_point } end } end score end
Returns an integer representing the total spam score found within the body, 0 if no spam is found.
Returns an integer representing the total spam score found within the body 0 if no spam is found .
body
<not_specific>