14 Rhymer: Using regular expressions to create rhyming words
In the movie The Princess Bride, the characters Inigo and Fezzik have a rhyming game they like to play, especially when their cruel boss, Vizzini, yells at them: Inigo: That Vizzini, he can fuss. Fezzik: I think he likes to scream at us. Inigo: Probably he means no harm. Fezzik: He’s really very short on charm. When I was writing the alternate.txt for chapter 7, I would come up with a word like “cyanide” and wonder what I could rhyme with that. Mentally I started with the first consonant sound of the alphabet and substituted “b” for “byanide,” skipped “c” because that’s already the first character, then “d” for “dyanide,” and so forth. This is effective but tedious, so I decided ... |
Get Tiny Python Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.