Class: Analyser
- Inherits:
-
Object
- Object
- Analyser
- Defined in:
- lib/engine/analyser.rb
Instance Method Summary collapse
- #analyse(sentence) ⇒ Object
-
#initialize ⇒ Analyser
constructor
A new instance of Analyser.
- #train_negative(path) ⇒ Object
- #train_positive(path) ⇒ Object
Constructor Details
Instance Method Details
#analyse(sentence) ⇒ Object
23 24 25 |
# File 'lib/engine/analyser.rb', line 23 def analyse sentence Classifier.new(@positive, @negative).classify(sentence) end |
#train_negative(path) ⇒ Object
17 18 19 20 21 |
# File 'lib/engine/analyser.rb', line 17 def train_negative path puts 'Training analyser with -ve sentiment' @negative.load_from_directory path puts '-ve sentiment training complete' end |
#train_positive(path) ⇒ Object
11 12 13 14 15 |
# File 'lib/engine/analyser.rb', line 11 def train_positive path puts 'Training analyser with +ve sentiment' @positive.load_from_directory path puts '+ve sentiment training complete' end |