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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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 3 months ago

Package Health Score

60 / 100
Full package analysis