Class: JohnDoe::Aiml
- Inherits:
-
Object
- Object
- JohnDoe::Aiml
- Defined in:
- lib/johndoe/aiml.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#emotions ⇒ Object
Returns the value of attribute emotions.
-
#knowledge ⇒ Object
Returns the value of attribute knowledge.
-
#patterns ⇒ Object
Returns the value of attribute patterns.
-
#responses ⇒ Object
Returns the value of attribute responses.
-
#rules ⇒ Object
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize ⇒ Aiml
constructor
A new instance of Aiml.
- #load(filename) ⇒ Object
Constructor Details
#initialize ⇒ Aiml
Returns a new instance of Aiml.
6 7 8 9 10 11 12 13 |
# File 'lib/johndoe/aiml.rb', line 6 def initialize @rules = [] @patterns = {} @responses = [] @default = [] @knowledge = [] @emotions = {} end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
5 6 7 |
# File 'lib/johndoe/aiml.rb', line 5 def default @default end |
#emotions ⇒ Object
Returns the value of attribute emotions.
5 6 7 |
# File 'lib/johndoe/aiml.rb', line 5 def emotions @emotions end |
#knowledge ⇒ Object
Returns the value of attribute knowledge.
5 6 7 |
# File 'lib/johndoe/aiml.rb', line 5 def knowledge @knowledge end |
#patterns ⇒ Object
Returns the value of attribute patterns.
5 6 7 |
# File 'lib/johndoe/aiml.rb', line 5 def patterns @patterns end |
#responses ⇒ Object
Returns the value of attribute responses.
5 6 7 |
# File 'lib/johndoe/aiml.rb', line 5 def responses @responses end |
#rules ⇒ Object
Returns the value of attribute rules.
5 6 7 |
# File 'lib/johndoe/aiml.rb', line 5 def rules @rules end |
Instance Method Details
#load(filename) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/johndoe/aiml.rb', line 15 def load(filename) data= YAML::load_file(filename) collect_data data @default = data['default'] @knowledge = data['knowledge'] normalise_default end |