https://github.com/tangerinearc/dissociated-press
a bigram Markov Chain Text Generator
https://github.com/tangerinearc/dissociated-press
dissociated-press markov-chain text-generator
Last synced: 8 months ago
JSON representation
a bigram Markov Chain Text Generator
- Host: GitHub
- URL: https://github.com/tangerinearc/dissociated-press
- Owner: tangerineArc
- Created: 2025-09-25T14:53:23.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-25T14:56:03.000Z (9 months ago)
- Last Synced: 2025-09-25T16:41:02.624Z (9 months ago)
- Topics: dissociated-press, markov-chain, text-generator
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dissociated Press
This a _bigram_ (order-2) Markov Chain Sentence Generator.
## Usage
> [!NOTE]
> Requires: Python 3.13+
Generate:
```sh
python3 markov/main.py -l OUTPUT_LENGTH < CORPUS
```
For help:
```sh
python3 markov/main.py --help
```
Run tests:
```sh
python3 -m unittest
```
## How it works?
1. corpus analysis: parse the source text and create a dictionary of word-to-word transitions with normalized frequency values
2. random generation: use a pseudo-random number generator to select the next word based on calculated probabilities (weights)
## What needs to be worked on?
- a better CLI experience
- enforce grammatical rules and proper punctuations up to some extent
- control the order with a parameter and appropriate implementation
- add a proper shitposting mode