Hailo::Role::Storage - A role representing a Hailo storage backend

  1. ATTRIBUTES
    1. ready
    2. initialized
    3. order
    4. brain
  2. METHODS
    1. new
    2. save
    3. learn_tokens
    4. make_reply
    5. token_total
    6. expr_total
    7. start_learning
    8. stop_learning
    9. start_training
    10. stop_training
  3. AUTHOR
  4. LICENSE AND COPYRIGHT

ATTRIBUTES

ready

Ask the storage backend if it considers itself ready to go. E.g. a storage that requires a brain would return false if it wasn't passed one.

initialized

If you're connecting to an existing storage that already has a populated schema and is ready to go this'll return true.

order

The Markov order (chain length) being used.

brain

The name of the resource (file name, database name) to use as storage.

METHODS

new

This is the constructor. It accept the attributes specified in "ATTRIBUTES".

save

Saves the current state.

learn_tokens

Learns from a sequence of tokens. Takes an array reference of strings.

make_reply

Takes an (optional) array reference of tokens and returns a reply (arrayref of tokens) that might be relevant.

token_total

Takes no arguments. Returns the number of tokens the brain knows.

expr_total

Takes no arguments. Returns the number of expressions the brain knows.

start_learning

Takes no arguments. This method is called by Hailo right before learning begins.

stop_learning

Takes no arguments. This method is called by Hailo right after learning finishes.

start_training

Takes no arguments. This method is called by Hailo right before training begins.

stop_training

Takes no arguments. This method is called by Hailo right after training finishes.

AUTHOR

Hinrik Örn Sigurðsson, [email protected]

Copyright 2010 Hinrik Örn Sigurðsson

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.