You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
4 years ago | |
---|---|---|
20000-leagues-under-sea.txt | 4 years ago | |
README.md | 4 years ago | |
markov-nl.py | 4 years ago |
README.md
Markov chain for NL
markov-nl.py
is a very minimalistic order-1 Markov model for natural language generation. It takes a file with a text and generates n sentences using a Markov chain. Just for fun.
Original source is here.
Usage
The following line generates 20 sentences using file.txt
as input.
$ markov-nl.py file.txt 20
For example, using the open domain book "20000 leagues under the sea" by Jules Verne:
$ markov-nl.py 20000-leagues-under-sea.txt
Contempt for the ocean it must have to a thousand miles an enthusiastic colourist.
Nemo. Whiskers like the ships bottom of the quays and not see how to keep ones self
Professor that before Vanikoro. Disheartened. Returning to finish please. Prompt his
movements and I saw floating under water is introduced which is there are real.
Advantageously as a submerged But the air by this book which were profoundly dark
spots. Landscape Captain you maintain yourselves in the day before. Ensued. Date.
For more help, use:
$ markov-nl.py --help