This is an extremely simple example of how to use AIML files in Ruby through the terminal. It uses the ProgramR gem to parse the .aiml files and to get an response of our questions.
This example uses the Sara Spanish set of AIMLs that you could find here. You could try to download another set to play with it.
To test this example, you should follow this steps:
-
Install Ruby version 2.2.3 e.g. (using RVM or RBenv or whatever).
-
Clone the repo and make the
bot.rbfile executable:
user@computer:~$ git clone git@github.com:dreamingechoes/aiml-ruby-example.git
user@computer:~$ cd aiml-ruby-example
user@computer:/aiml-ruby-example$ chmod +x bot.rb- Install the
ProgramRgem by executing:
user@computer:/aiml-ruby-example$ gem install programr- Then you are ready to test this by executing the file and starting to type some questions to get an answer:
user@computer:/aiml-ruby-example$ ./bot.rbWhen you've tired of talking to the bot, type quit to exit.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
aiml-ruby-example is released under the MIT License.