easy-markov-chain

Easy Markov Chain generator

Usage no npm install needed!

<script type="module">
  import easyMarkovChain from 'https://cdn.skypack.dev/easy-markov-chain';
</script>

README

Easy Markov Chain

Easy to use Markov Chain generator without any external dependencies.

Installing

npm install easy-markov-chain

Usage

const chain = require('easy-markov-chain')

let messages = [ … ] // an array of messages, sentences, strings

for (message of messages) {
    chain.learn(message)
}

chain.normalize()

console.log(chain.generate(10))