项目作者: spejamchr

项目描述 :
Tweet random haikus
高级语言: Ruby
项目地址: git://github.com/spejamchr/haiku_ebooks.git
创建时间: 2018-02-26T00:29:39Z
项目社区:https://github.com/spejamchr/haiku_ebooks

开源协议:MIT License

下载


haiku_ebooks

Tweet random haikus

See the result on Twitter

I like Markov Chains, and I like haikus, so this is my attempt at creating a
Twitter bot that tweets Markov-Chain-generated haikus. It’s not meant to be
blazing fast, but it should count syllables very accurately.

Examples

Tweet a random haiku:

  1. cd /path/to/haiku_ebooks/bin
  2. ./haiku_ebooks

The first time will take longer than normal (~1 minute), because it has to parse
the CMU pronunciation dictionary for word syllable lengths and generate a
persistent Markov Chain. Subsequent runs should only take ~10 seconds.

Requirements

  • ruby (I’m using ruby 2.4.2)
  • bundler for installing:
  • You’ll also need to bring your own source texts. Consider using Project
    Gutenberg
    .

Install

  • Clone the git repo: git clone https://github.com/spejamchr/haiku_ebooks.git
  • Run bundle install
  • Rename data/keys.example.yml to data/keys.yml and put your Twitter keys
    and access tokens in there
  • Put some .txt files in the data/text/ directory. Your Markov Chain will be
    built from them.

Author

Original author: Spencer Christiansen

License

haiku_ebooks is released under the MIT License.