Markov Chaining
var Markov = require("markoff");
var mark = new Markov();
[
"the quick brown fox jumps",
"be quick now",
"now is the time for all good men"
].forEach(function(sentence) {
mark.addTokens(sentence.split(/\s+/g));
});
console.log(mark.chain(4).join(' '));
// might print something like "be quick brown fox" or "the quick now is"
// TODO. State what the module does.
npm install markoff
npm test
- Joshua T Corbin