# Mathematics of Rhyme (perfect, slant)

I have recently been working on some programming frameworks incorporating audio analysis of the English language, particularly whether words "rhyme" or not (pure rhyme, slant rhyme, etc.)

Short from using an AI, is their any way to mathematically assume that two words rhyme? Any ideas for such an approach?

So far, I have worked on breaking the words down into their syllables, but from there I am a bit lost. Another idea I have had is to assign a number to each letter in each syllable, and then average the sums of these.

However, there are obviously some shortcomings with this: completely different letters could add (and average to the same thing), yet the words could still not rhyme. I would like to stay away from a "brute-force" approach (eg no mapping of all letter sounds/combinations)

• In the last paragraph, you mention the word letters, which suggests that you are working from written English. Rhyme is a phenomenon of spoken English, and English spelling does not represent English pronunciation consistently. Hence, it does not represent English rhyme. Period. Why not start with a consistent representation, like the phonemic one used in Kendall and Knott's Pronouncing Dictionary? Aug 12, 2021 at 14:37
• Interesting. Your point about rhyme being a phenomenon of spoken English, and not written English shows I obviously overlooked some aspects of this. However, by looking at two side-by-side words, most people can tell if they rhyme or not, which seems to go against what you said. I am just looking for a simple formula using phonetics, disregarding some obvious pitfalls such as regional pronunciation. Aug 12, 2021 at 15:04
• @Finn_Lancaster People can only tell by looking at words side by side because they know (through education and a lifetime of exposure) how those words are pronounced – that is, they know what spoken words the written words represent. Take that away (as you’d have to for a computer), and people are lost. Can you tell me whether the names Gough (Street), Crough (surname) and Slough (city) rhyme? If you’re not familiar with the names from speech beforehand, you can’t. (They don’t, by the way – Gough Street is like ‘cough’, the other two rhyme with ‘vow’.) Aug 12, 2021 at 17:09

The standard linguistic approach to this problem is based on the phonological theory of features. The premise is that spoken language (the basis for rhyme) is a string of segments organized into syllables, and each segment is a network of "features", that is properties of sounds (such as "nasal", "labial", "voiced"). Various types of "rhyme" are based on identity relations between two words. The simplest case is "two identical syllables", meaning two syllables whose internal structure is the same, which means the segments are the same and in the same order. And then you check if the conjunction of features composing each corresponding segment are identical. There are zillions of kinds of rhyme, differing in which segments are subject to the identity requirement (alliteration is about syllable onset identity, assonance is about syllable nucleus identity, and so on).

Spelling gets involved because these days we read this stuff and don't hear it around the fire. Most rhymes were composed in the past and are just repeated over time. Owing to language change, a certain text might rhyme for one dialect but not for another. People can therefor disagree over whether X and Y rhyme. Hence the name of the Renaissance composer Dowland is assumed to be pronounced [do:land] and not [daʊland] despite modern practices, because it rhymes with (Latin) dolens.

The main impediment to computing probability of rhyme is dialect variation. The CMU dictionary provides a large supply of phonetically-notated words of "English" (including a lot of non-English words used by English speakers), and you can map their segmental notation (e.g. " EY1 ", " DH ") to standard features (see Introducing phonology for a list). You may want to manually adjust their pronunciations in case they give a bizarre transcription ('chutzpah' is given as [tʃatspɑ], lulz). However, the vowels of "smog" and "dog", or "Mary, merry, marry" differ dialectally, so there will be disagreement over whether "Mary" and "merry" rhyme.

It is therefore a matter of personal judgment whether two words rhyme. You can use yourself as a judge and rest your algorithm aganst your judgments, or you can pick someone else to judge. If you try to extract rhyme from the extant corpus of all supposed rhymes (in English), the variability wall will be rather tall, but still, "cat" and "dog" don't rhyme anywhere.

• thanks for all the effort you put into that answer! +1 for sure, and accept! Aug 12, 2021 at 16:09