https://github.com/luludotdev/markov
CLI tool to analyse text and generate like sentences using markov chains.
https://github.com/luludotdev/markov
Last synced: 11 months ago
JSON representation
CLI tool to analyse text and generate like sentences using markov chains.
- Host: GitHub
- URL: https://github.com/luludotdev/markov
- Owner: luludotdev
- License: mit
- Created: 2020-10-05T11:21:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T09:00:21.000Z (over 5 years ago)
- Last Synced: 2025-03-31T16:02:17.779Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💬 Markov 
> CLI tool to analyse text and generate like sentences using markov chains.
## 💾 Installation
Markov is built into a single binary. You can build this yourself with Golang tooling or download a prebuilt release from the [Releases](https://github.com/lolPants/markov/releases) page.
Nightly builds are also available as artifacts on the [Actions](https://github.com/lolPants/markov/actions?query=workflow%3A%22Golang+Build%22) page.
## 🚀 Usage
Markov is a CLI tool, and as such you can read the included help with `markov --help`.
```
Available Commands:
analyse Read lines from stdin and output a model file to stdout
completion Generate completion script
generate Read model from stdin and output generated lines to stdout
help Help about any command
version Print version information
Flags:
-h, --help help for markov
-v, --version print version
Use "markov [command] --help" for more information about a command.
```
## 📋 Example
> This example assumes you are running a Bash-like shell and have already organised your sample lines into a line separated `lines.txt` file.
```sh
# Store model for repeated use
$ markov analyse < ./lines.txt > ./model.json
$ markov generate < ./model.json
# As a one liner
$ cat ./lines.txt | markov analyse | markov generate
```