Socket
Book a DemoInstallSign in
Socket

markov_chain_chat_bot

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markov_chain_chat_bot

0.1.7
bundlerRubygems
Version published
Maintainers
1
Created
Source

== Markov chain chat bot

A chat bot utilizing Markov chains. It speaks Russian and English.

=== Examples

Basic usage:

require 'markov_chain_chat_bot'

bot = MarkovChainChatBot.from(Hash.new) bot.learn("one two three two one") bot.answer("count up and down please") #=> "one two three two three two one two one two three two one two one" bot.learn("three four six") bot.answer("count from three please") #=> "three two one two one two three four six"

One may save the bot's knowledge into key-value storage:

require 'markov_chain_chat_bot' require 'auto_marshalling_map' require 'gdbm'

1.

kvs = GDBM.open("chat_bot.dat") bot = MarkovChainChatBot.from(AutoMarhsallingMap.new(kvs)) bot.learn("one two three two one") kvs.close()

2.

kvs = GDBM.open("chat_bot.dat") bot = MarkovChainChatBot.from(AutoMarhsallingMap.new(kvs)) bot.answer("count up and down please") #=> "one two three two three two three two one two one"

FAQs

Package last updated on 31 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.