Class: Help

Inherits:
Cogibara::OperatorBase show all
Defined in:
lib/cogibara/operators/help.rb

Overview

require_relative ‘wolfram_alpha.rb’

Instance Attribute Summary

Attributes inherited from Cogibara::OperatorBase

#clientID, #message_structure, #message_text, #operator_config

Instance Method Summary collapse

Methods inherited from Cogibara::OperatorBase

#confirm, #initialize, #process_file, #receive_message, #say

Constructor Details

This class inherits a constructor from Cogibara::OperatorBase

Instance Method Details

#process(message) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/cogibara/operators/help.rb', line 5

def process(message)
  operators = Cogibara::dispatcher.operators.keys

  soft_operators = operators.reject{ |o| o.upcase != o}
  hard_operators = operators

  "I understand the following categories of natural speech: #{soft_operators}, and keyword queries of the form #{Cogibara::config.name}: #{hard_operators}. Most natural speech categories implement a more natural response, so, for example, 'what is 18 dollars in rupees' activates the knowledge module, and returns 'rupee 968.31(Indian rupees)', while the 'ask' keyword sends the query to the knowledge engine and prints raw output, so 'cucumber ask what is 18 dollars in rupees' = 'Input Interpretation: convert $18  (US dollars) to Indian rupees, Result: rupee968.31  (Indian rupees), 1-year  minimum | rupee931.42  (October 4, 2012 | 7 months ago) 1-year  maximum | rupee1030.38  (June 24, 2012 | 10 months ago)"
end