0.0
No commit activity in last 3 years
No release in over 3 years
A No Bullshit Markov Chain Generator in Pure Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Markov Polo

A No Bullshitâ„¢, Super-Tiny Markov Chain engine in Pure Ruby

Build Status Gem Version Coverage Status Code Climate

Getting Started

Getting started is very simple. First, install the Gem:

  gem install markov-polo

or, in your gem file

  gem 'markov-polo'

Using the Gem is very simple. First, create a Chain

require 'markov-polo'

chain = MarkovPolo::Chain.new

To train your chain, it's just like with any Array.

chain << "These are some sample words"
chain.push "This is some more sample text"

Generating an output is also very simple

puts chain.generate   # => These are some more sample words

Getting access to the raw chain data can be done by:

chain.to_h            # => Hash

Restoring a chain from a hash can be done through the constructor

chain = MarkovPolo::Chain.new { ... }

Likewise, with the Hash, you can store your Chain as a JSON file, or other format of your choosing.

require 'json'
File.write "cache_chain.txt", JSON.generate(chain.to_h)