Module: TWSSClassifier

Defined in:
lib/twss-classifier.rb

Class Method Summary collapse

Class Method Details

.classifierObject



11
12
13
# File 'lib/twss-classifier.rb', line 11

def classifier
  @classifier ||= YAML::load(File.read(File.expand_path('../twss-classifier/twss-classifier.yaml', __FILE__)))
end

.is_twss?(line, threshold = 0.9) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/twss-classifier.rb', line 7

def is_twss?(line, threshold = 0.9)
  classifier.classify(line) > threshold
end