Class: DespamilatorFilter::MixedCase
- Inherits:
-
Despamilator::Filter
- Object
- Despamilator::Filter
- DespamilatorFilter::MixedCase
- Defined in:
- lib/despamilator/filter/mixed_case.rb
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
8 9 10 |
# File 'lib/despamilator/filter/mixed_case.rb', line 8 def description 'Detects mixed case strings.' end |
#name ⇒ Object
4 5 6 |
# File 'lib/despamilator/filter/mixed_case.rb', line 4 def name 'Mixed Case String' end |
#parse(subject) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/despamilator/filter/mixed_case.rb', line 12 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 |