-- Leo's gemini proxy

-- Connecting to rwv.io:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

Using markov chains to generate gibberish


A couple of weeks ago I was playing with Haunt to see if it was an good candidate to replace Jekyll for a couple of websites I host.


Haunt project page

Jekyll project page


Playing around with it, I wanted to generate some text and started porting some code I wrote in Clojure to Guile Scheme. It's a basic implementation of Markov Chains; analyze input to record the likelihood some term(s) are followed by other terms and use those statistics to generate data at random.


Clojure markov repo

Scheme markov repo


This holiday season I wondered how hard to would be to make it run in Racket and produce some content for this capsule. Turns out the common ground between Racket and Guile is R6RS. Long story short, this capsule can now Lorem Ipsum into infinitum! Freshly generated for you:


Lorem Ipsum


I have no knowledge of Latin but I am pretty sure the result is very bad (but good enough as filler text). But we can do better than that! With a bigger text and a "look back" of 3 words we can generate stuff that sounds like it came from a very famous book (my apologies to fans of this book for being inappropriately playful):


Biblish


Again freshly generated on every visit.


Cheers,

R.



--

📅 2022-12-29

🏷 floss

📧 hello@rwv.io

CC BY-NC-SA 4.0

-- Response ended

-- Page fetched on Thu May 2 19:00:08 2024