I need a good Rhyming Dictionary and other tools for poetry

I very well may create that, if it doesn’t exist.

1 Like

I whipped up a no-frills front end to the Datamuse API: http://rhyme.ninja/
so now you can type in “iced” and “crime” and it’ll give you “heist”
or “cat” + “animal” -> “rat”, “bat”, etc.

It’s currently just looking up synonyms, though; it would be nice to generalize it to a broader notion of “semantically related to somehow”. It’s on my to-do list.

Next I’ll add “two words related to X that rhyme with each other”

6 Likes

Could you do “a word related to X, and a word related to Y, that rhyme with each other”? That could revolutionise nonsense verse.

2 Likes

Sure, I’ll do that next.

The initial version of “two words related to X that rhyme with each other” is up now. It’s hit-and-miss - the Datamuse “related words” function doesn’t always return intuitive results, so I may need to extend it. But it’s not bad when it does get results, e.g.

RHYME NINJA

Rhyming word sets that are related to animal :
bovine / canine / equine
cats / rats
dog / hog
dog / hog / wild dog
livestock / stock

RHYME NINJA

Rhyming word sets that are related to farm:
agriculture / aquaculture
block / livestock / lock
cultivate / estate
cultivate / estate / operate
cultivating / operating
cultivation / operation
exploitation / operation
farmland / land
farmstead / homestead
operation / plantation
produce / use

Also it’s super slow. I would need to cache a local copy of the rhyming data (at least) to make it usably fast.

1 Like

RHYME NINJA

Pairs of rhyming words where the first word is related to crime and the second word is related to heaven:
assassination / salvation
case / airspace
criminality / immortality
criminalization / salvation
fraud / god
sin / tin
victimization / salvation
violation / salvation

RHYME NINJA

Pairs of rhyming words where the first word is related to writing and the second word is related to death :
brief / grief
composition / imposition
institution / execution
penned / end
submission / imposition

I was hoping it’d get “quill / kill”, but “quill” didn’t come up in the top 100 words related to writing. I bumped it up to 1000 and it got a ton more, my favorites of which were “story / gory” and “story / memento mori”, but it still didn’t get “quill / kill”. It’s too slow at 1000, though - I’m going to have to download the CMU Rhyming Dictionary myself if I want this to be both fast and useful.

It’s certainly useful as a proof of concept, though - try it out and let me know what you think.

2 Likes

This is cool! I asked for something where word one related to cheese and word two related to tribute and it tolerably quickly produced pepperoni / ceremony, pepperoni / testimony, and souffle / pay.

I figure if I were able to do enough relational work on the database that would help with my cheese spoonerisms but that would be for another day!

1 Like

Ah - it’s not the overhead of the web service call that’s making it slow. The default API to the CMU Pronunciation Dictionary is already slow.

time python rhymes.py
[u'diming', u'liming', u'priming', u'rhyming', u'timing']

real    0m1.493s
user    0m1.412s
sys     0m0.080s

I’ll need to preprocess the CMU pronunciation dictionary into a file or DB indexed by the rhyming part.

This is getting nontrivial; time to put it on github… https://github.com/pace212/rhyme-ninja/

Did you forget to push? Or did you intentionally post the github link with just a license and readme? :slight_smile:

It just took me a while to get everything ready. It’s pushed now!

1 Like

It’s fast now!

For example,
http://rhyme.ninja/cgi-bin/rhyme.rb?rel1=space
previously took 13.6s, and now takes 0.6s

RHYME NINJA

Rhyming word sets that are related to space :
accommodation / location
air / square
floor / pore
place / space
site / upright
slot / spot

4 Likes

Here’s a fun one: Pairs of rhyming words where the first word is related to interactive and the second word is related to fiction

1 Like

Exciting/writing

Excellent!

1 Like

Today I reworked the UI to hopefully be more intuitive. Check it out and let me know if you think it’s good, still too confusing, or if you have any suggestions.

1 Like

Progress:

  • create and respect a blacklist file (eliminate slurs and some errors, LMK if you find any I missed)
  • fix a destructivity bug that was causing 75% of rhymes to go missing
  • fix the handling of words with no primary stress (now we dwim them instead of ignore them)
  • upgrade the CMU Pronouncing Dictionary to the latest version (more words!)
  • eliminate (some) duplication. I still need to figure out why the “-eer” words below didn’t all get grouped together.

This one’s for you, @robinjohnson:

RHYME NINJA

Rhyming word sets that are related to “pirate”:
air / hair / swear
air / swear
attacker / cracker / hacker
bit / lafitte
branded / commanded
brave / dave / slave
buccaneer / musketeer
career / commandeer / mutineer
chinese / seas
coast / ghost
cried / replied
daring / swearing
disgrace / face
exclaimed / named / proclaimed
french / wench
gang / hang
hair / swear
handsome / ransom
raider / trader
sailor / whaler
soul / stole

1 Like

So I wrote another limerick game in 4 hours for ECTOCOMP, and I used Rhyme Ninja to help. I still ended up using Rhymezone and thesaurus.com as well, because I haven’t implemented any way to filter out rare words from Rhyme Ninja yet, and also the “related words” data I get from the Datamuse API isn’t synonyms per se. If I want to turn Rhyme Ninja into my one-stop shop for limerick assistance, I’ll need to add those two features.

That said, Rhyme Ninja was still helpful for generating rhyming word sets! I ended up using 3 or 4 great rhymes it suggested, my favorite of which is

Rhyming word pairs where the first word is related to “search” and the second word is related to “vampire”
which gave me
conduct / sucked

(:

3 Likes

Feature suggestion, add custom/other dictionaries. I’m thinking in Spanish, right now :wink:

That ought to be pretty straightforward - easier than English, actually, because Spanish is phonetic. All I need is a big list of Spanish words, and a way to filter out the rare ones. Like, on rimar.io when you give it “amor”, if you untick the “Palabras raras” tickybox, it filters out stuff like “azamor, chimor, memor, alamor, chemor, marmor, cundeamor, mor., montemor, elbiamor”. There are a lot of those, and they really clutter things up if the big list of words contains rare words like that.

For English I use two word frequency lists and a lemma dictionary for word forms; do you know of anything like that for Spanish that is freely licensed? I found a Spanish word frequency list but it’s only 8600 words, and that’s probably not enough to be useful.

I might not need a lemma dictionary for Spanish because, except for irregular verbs, all word forms are consistent, so I could probably find or implement a Spanish word form generator/identifier algorithmically. I would need all the irregular verb forms, though.

I went ahead and made a Spanish front end. The output is completely wrong due to lack of the Spanish word list, but I’ve refactored the back end to be multilingual, so it’ll be ready as soon as we can find the data we need.

Also, I’m sure there are many mistakes or awkward phrasings in my poor Spanish. For instance, I’m sure there’s a better way to say “Conjuntos de rimas relacionadas con”. When you notice them, would you be so kind as to fix them or let me know so I can fix them? Thanks!

Thanks, I have little time to take a deep look to all this to be helpful, but I will spread the word and point to the thread, just in case someone could help. I will be back next week!

1 Like

Progress report: I’ve been working on getting rid of bad rhymes and increasing good rhymes. The pronunciation dictionary has some quirks to it, such as

curry [K AH1 R IY0] / hurry [HH ER1 IY0]
ear [IY R] / beer [B IH R]
illicit [IH2 L IH1 S AH0 T] solicit [S AH0 L IH1 S IH0 T]
faring [F EH1 R IY0 NG] / glaring [G L EH1 R IH0 NG]
caught [K AA1 T] / fought [F AO1 T]
bong [B AA1 NG] / song [S AO1 NG]
but NOT bar [B AA1 R] / score [S K AO1 R], so we leave it alone if it’s followed by R

Rhyme Ninja now does a preprocessing step to dwim these differences, so now curry rhymes with hurry, ear rhymes with beer, etc.

The first example I gave in this thread was

RHYME NINJA

Rhyming word sets that are related to animal :
bovine / canine / equine
cats / rats
dog / hog
dog / hog / wild dog
livestock / stock

Now it does much better. It doesn’t give bovine / canine / equine, since those rhymes aren’t on the primary syllable, and it does give some good ones that it didn’t give before, like:

RHYME NINJA

Rhyming word sets that are related to animal
bitten / kitten
cetacean / coloration / communication / conservation / domestication / experimentation / inoculation / liberation / predation / respiration / vaccination / vegetation
claws / jaws / paws
fauna / iguana
otter / slaughter

3 Likes