Sha256: 96d91040bbe21e01e3615c1627b93868295d08e8f064faf915cbd9ff51352b9c

Contents?: true

Size: 407 Bytes

Versions: 5

Compression:

Stored size: 407 Bytes

Contents

require 'despamilator/filter'

module DespamilatorFilter

  class SquareBrackets < Despamilator::Filter

    def name
      'Square Brackets'
    end

    def description
      'Detects each square bracket in a string'
    end

    def parse subject
      subject.text.downcase.scan(/(\[|\])/).each do |match|
        subject.register_match!({:score => 0.05, :filter => self})
      end
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
despamilator-2.1.4 lib/despamilator/filter/square_brackets.rb
despamilator-2.1.3 lib/despamilator/filter/square_brackets.rb
despamilator-2.1.2 lib/despamilator/filter/square_brackets.rb
despamilator-2.1.1 lib/despamilator/filter/square_brackets.rb
despamilator-2.1 lib/despamilator/filter/square_brackets.rb