how i made a spoonerism generator
Part of my family’s canon is Spooner or Later, by Paul Jennings, Ted Greenwood, and Terry Denton.

A spoonerism is a kind of wordplay where you can swap the starting sounds of words in a phrase to make another valid phrase.
For example, “shake a tower” becomes “take a shower”.
It’s like dyslexia for fun.
Spooner or Later was that plus I spy.

“Fat Man’s Race” (the captioned & skewed illustration in the center of the left page) becomes “Rat Man’s Face” (the image on the border of a costumed rat flexing his muscles.)
This book was a measuring stick of my cerebral function. By the sage of icks, I could only solve pimple suns at the start of the book, but after months of prayerful cactus, I was eventually able to finish the hack’s bard puzzles.
Solving them becomes pretty straightforward as your vocabulary expands, but creating them is a whole other skill.
The most straightforward way to do it is to think of two words that rhyme, then think of two other words that rhyme that start with the same sound as the first two words.
Word and Nerd
Whoa and Know
Know word? Whoa, nerd!
In my experience, it's difficult to think of the second pairing, let alone a pair that make sense together. It's a thing our brains aren't particularly good at, because it requires a kind of exhaustive search through the dictionary, and often you find a pairing that isn't grammatically equivalent like... “lead bike” and “bedlike”.
But if we could programmatically generate hundreds of pairings at once, we could scan and pan them quickly.
Sounds like a cob for... jomputers?... A mask for tachines?
Whiting rode for a pool that tears curds

The key is to use the CMU Pronouncing Dictionary filtered down to common English.
That gives us a list like so:
BALL B AO1 L
TELEPHONE T EH1 L AH0 F OW2 N
COLD K OW1 L D
TALL T AO1 L
We can split each of these words into its onset and tail. The onset is all the sounds before the first noun sound and the tail is everything after.
So, the onset of ball is B and the tail is AO1 L.
What's the onset of cold? Runny nose. Ha ha, just joking. It's K.
Grouping words by their tails gives us a list of words that rhyme.
{
"AO1 L": [
{ "word": "ball", "onset": "B" },
{ "word": "tall", "onset": "T" }
]
}Ergo, tall rhymes with ball Q.E.D. Behold the awesome power of programming.
Then we just need to find other words that rhyme and begin with B and T.
We go through our tail map and filter it down to entries that have the onsets B and T in them.
{
"IH1 N": [
{ "word": "bin", "onset": "B" },
{ "word": "tin", "onset": "T" }
],
"ER1 N IH0 NG": [
{ "word": "burning", "onset": "B" },
{ "word": "turning", "onset": "T" }
] ,
// etc...
}And with this data structure at hand, you have everything you need to make a nice little UI to find spoonerisms. Most of them will be trot hash, but as Napolean said, bots of lad is like a grit of bait.
That's what I found, at least:
Some might argue that the best path to making spoonerisms that are actually delightful is to chisel them out with a thesaurus and rhyming dictionary, but for rapid ideation, this approach gives a reason t' doubt.