How to use the rita.RiMarkov function in rita

To help you get started, we’ve selected a few rita examples, based on popular ways it is used in public projects.

github spences10 / twitter-bot-playground / src / markov-bot.js View on Github external
.on('end', () => {
      const markov = new rita.RiMarkov(20)
      markov.loadText(inputText)
      const sentence = markov.generateSentences(1)
        .toString()
        .substring(0, 140)
      bot.post('statuses/update', {
        status: sentence
      }, (err, data, response) => {
        if (err) {
          console.log(err)
        } else {
          console.log('Markov status tweeted!', sentence)
        }
      })
    })
}

rita

tools for generative natural language

GPL-3.0
Latest version published 7 days ago

Package Health Score

70 / 100
Full package analysis

Similar packages