A Ruboty Handler + Actions to learn your key-value into brain.
Ruboty is Chat bot framework. Ruby + Bot = Ruboty
Add this line to your application's Gemfile:
gem 'ruboty-brain_dictionary'
And then execute:
$ bundle
Command | Pattern | Description |
---|---|---|
learn | /learn\s{1}?(?<key>.+)?\s{1}(?<value>.+)?\z/ | learn key-value |
remember | /remember\s{0,1}?(?<key>.+)?\z/ | remember your ruboty brain_dictionary that match your keys. |
dict | /dict\s{1}?(?<key>.+)?\z/ | show your value from brain. |
forget | /forget\s{0,1}?(?<key>.+)?\z/ | forget your ruboty brain_dictionary that match your key. |
- learn key-value
>ruboty learn tu ka
>ruboty remember tu
tu,ka
- remember your ruboty brain_dictionary that match with your keys.
>ruboty learn hoge hoge-value
>ruboty learn hige hige-value
>ruboty learn hage hage-value
>ruboty learn hoo bar
# remember all
>ruboty remember
hage,hage-value
hige,hige-value
hoge,hoge-value
hoo,bar
# remember match keys
>ruboty remember ge
hage,hage-value
hige,hige-value
hoge,hoge-value
# remember match key
>ruboty remember hoo
hoo,bar
>ruboty learn hoge hoge-value
>ruboty learn hige hige-value
>ruboty learn hage hage-value
>ruboty learn hoo bar
>dict hoge
hoge-value
>dict hoo
hoo-value
>dict hogea
>
- forget your ruboty brain_dictionary that match with your key.
>ruboty learn hoge hoge-value
>ruboty learn hige hige-value
>ruboty learn hage hage-value
>ruboty learn hoo bar
# remember all
>ruboty remember
hage,hage-value
hige,hige-value
hoge,hoge-value
hoo,bar
# forget hoo & confirm
>ruboty forget hoo
success delete key 'hoo'
>ruboty remember
hage,hage-value
hige,hige-value
hoge,hoge-value
# forget hoo ( not exist )
>ruboty forget hoo
no key 'hoo'
Name | Description |
---|---|
-- | -- |
Name | Description |
---|---|
-- | -- |
- Fork it ( https://github.com/tbpgr/ruboty-brain_dictionary/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request