Sha256: 17a02f00ebb9a15a40c333eba41b7065ccf3a85e727a5f7e6ef35f32f16b091b

Contents?: true

Size: 586 Bytes

Versions: 12

Compression:

Stored size: 586 Bytes

Contents

module Gluttonberg
  module Content
    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
  end #Content
end #Gluttonberg

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gluttonberg-core-3.0.2 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-3.0.1 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-3.0.0 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.6.4 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.6.3 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.6.2 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.6.1 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.6.0 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.5.9 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.5.8 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.5.7 lib/gluttonberg/content/despamilator/filter/mixed_case.rb
gluttonberg-core-2.5.6 lib/gluttonberg/content/despamilator/filter/mixed_case.rb