https://github.com/deciduously/markov
A mini markov chain in Rust
https://github.com/deciduously/markov
Last synced: 8 months ago
JSON representation
A mini markov chain in Rust
- Host: GitHub
- URL: https://github.com/deciduously/markov
- Owner: deciduously
- Created: 2019-04-16T17:05:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-23T17:59:52.000Z (about 7 years ago)
- Last Synced: 2025-04-01T14:19:02.452Z (about 1 year ago)
- Language: Rust
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# markov
A mini markov chain, translated from the [example by orangeduck](http://theorangeduck.com/page/17-line-markov-chain)
## Requirements
[Rust](https://rustup.rs)
## Usage
```
$ cargo run -- -h
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/markov -h`
markov 0.1.0
deciduously
USAGE:
markov [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --input Input text file
-l, --length Output length
```
## Example Output
```
$ cargo run --release
Compiling markov v0.1.0 (/home/ben/code/markov)
Finished release [optimized] target(s) in 0.58s
Running `target/release/markov`
An actor experiences
Other peoples lives
Through a metamorphosis of mind
Words sifted through a Forest, beneath the blowing gale,
The waves have now the year of 1897, and on like that.
I can't abear it. I killed last night.
I wonder, 'struth, I wonder if the listener please,
A most important thing;
But Fortune to a thousand times, but I
Would have him with his prophetic bill.
The great Colosse, erect to Memory;
And what the royal feast!
See here the blue night, railway stations.
The water and fire his courage on despair
And utter dissolution, as the love of slaughter;
Many indeed are the men
With spears gathering at his feet: and my evening hours.
Last evening when it rests,
Leaves to be
Of work may be shared by not crossing the line,
Though that same morning officers and men.
Continues yet the dream
```