Skip to content
forked from barrucadu/markov

Markov chain text generator, as used for KingJamesProgramming

License

Notifications You must be signed in to change notification settings

rasmusgo/markov

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

The program presents a REPL, from which you can generate text in a number of different ways, a list of commands can be produced by typing help, and help for specific topics can be found by typing help topic.

Dependencies

  • python3
  • docopt

Getting Started

  1. Download the KingJamesProgramming corpus:

    wget http://misc.barrucadu.co.uk/pub/KingJamesProgramming.tar.xz
    tar xvf KingJamesProgramming.tar.xz
    
  2. Fire up the program

    python3 /path/to/repo
    
  3. Generate text

    train 3 --noparagraphs /path/to/KingJamesProgramming/*
    tokens 350
    

Warning: Termination

The paragraphs and sentences generators may not terminate. Because they generate blocks of text at a time, and a block only ends when a specific token (such as a paragraph break) occurs, if the generator gets stuck in a loop, the token may never come up.

One way to resolve this would be to have a loop detector, but I haven't got around to doing this yet.

About

Markov chain text generator, as used for KingJamesProgramming

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published