Class: Plino::Classifier

Inherits:
Object
  • Object
show all
Defined in:
lib/plino/classifier.rb

Overview

This class is used for classification of texts as spam or ham

Constant Summary collapse

SPAM =
'spam'.freeze
HAM =
'ham'.freeze

Instance Method Summary collapse

Instance Method Details

#ham?(text) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/plino/classifier.rb', line 12

def ham?(text)
  !spam?(text)
end

#spam?(text) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/plino/classifier.rb', line 8

def spam?(text)
  classifies_as?(SPAM, text)
end