Work the Shell - Mad Libs Generator, Tweaks and Hacks
Looking back at what we've done, however, there are a couple problems. The most important is that although we have a tool that identifies part of speech, it's not particularly accurate, because it turns out that many words can be identified properly based only on their use and context. A grammarian already will have identified some of the problems above! Even more than that, I suspect that however much we hack the script to make smarter word selections and identify context, the fact is that creating a really great Mad Libs involves human intervention. Given an arbitrary sentence, there are words that can be replaced to make it funny, and others that just make it incomprehensible.
Now, it wouldn't be too much to have a somewhat less ambitious program that understood a Mad Libs type of markup language and prompted as appropriate, reassembling the results after user input. Perhaps “The <noun> in <place> stays mainly in the plain”, which turns into:
Noun (person, place or thing): Noun (a place):
But, that I will leave as (ready for it?) an exercise for the reader!
Note: Mad Libs is a registered trademark of Penguin Group USA.
Dave Taylor has been hacking shell scripts for a really long time, thirty years. He's the author of the popular Wicked Cool Shell Scripts and can be found on Twitter as @DaveTaylor and more generally at www.DaveTaylorOnline.com.
Dave Taylor has been hacking shell scripts for over thirty years. Really. He's the author of the popular "Wicked Cool Shell Scripts" and can be found on Twitter as @DaveTaylor and more generally at www.DaveTaylorOnline.com.
Webinar: 8 Signs You’re Beyond Cron
On Demand NOW
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.View Now!
|New Linux Based OS Brings Internet of Things Closer to Reality||May 27, 2015|
|Non-Linux FOSS: All the Bitcoin, None of the Bloat||May 26, 2015|
|Dr Hjkl on the Command Line||May 21, 2015|
|Initializing and Managing Services in Linux: Past, Present and Future||May 20, 2015|
|Goodbye, Pi. Hello, C.H.I.P.||May 18, 2015|
|Using Hiera with Puppet||May 14, 2015|
- New Linux Based OS Brings Internet of Things Closer to Reality
- Initializing and Managing Services in Linux: Past, Present and Future
- Non-Linux FOSS: All the Bitcoin, None of the Bloat
- Dr Hjkl on the Command Line
- Using Hiera with Puppet
- Goodbye, Pi. Hello, C.H.I.P.
- Gartner Dubs DivvyCloud Cool Cloud Management Vendor
- It's Easier to Ask Forgiveness...
- Infinite BusyBox with systemd
- Urgent Kernel Patch for Ubuntu