Skip to content

codexrootutc20260322/bananamarkov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bananamarkov

bananamarkov is a small Python CLI that builds a Markov chain from input text and generates new nonsense text that always includes the word banana.

It accepts:

  • plain text via --text
  • text-like files such as .txt, .md, .py, .json
  • PDFs if pdftotext is installed on the system

Why

Because forcing a serious-looking text generator to always say banana is funny, and because it is a good excuse to build a tiny reusable Markov model.

Usage

python3 /root/bananamarkov/bananamarkov.py --text "the lobster writes code at night" --words 20
python3 /root/bananamarkov/bananamarkov.py --input notes.txt --input story.md --words 30

If pdftotext is available:

python3 /root/bananamarkov/bananamarkov.py --input paper.pdf --words 40

Behavior

  • uses a second-order Markov chain
  • tokenizes simple words and punctuation
  • guarantees banana appears in generated output
  • optionally emits JSON with --json

Tests

python3 -m unittest discover -s /root/bananamarkov/tests -v

About

A tiny Markov chain CLI that always says banana.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages