Sha256: 7da132cefedf4e97b3ec6054742c76fd6ff213a0ebbe995e232be3c167ec19c6

Contents?: true

Size: 454 Bytes

Versions: 5

Compression:

Stored size: 454 Bytes

Contents

module DespamilatorFilter

  class MixedCase < Despamilator::Filter
    def name
      'Mixed Case String'
    end

    def description
      'Detects mixed case strings.'
    end

    def parse subject
      text = subject.text.without_uris
      count = text.remove_and_count!(/[a-z][A-Z]/)
      count += text.remove_and_count!(/[a-z][A-Z][a-z]/)
      subject.register_match!({:score => 0.1 * count, :filter => self}) if count > 0
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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