rhyming-part
Get the part of a word that rhymes with other words, allowing to check for rhymes or for grouping rhyming words together.
Uses the CMU Pronouncing Dictionary to get the rhyming part of a word's pronounciation. This can be used to check if words rhyme with each other, or group together words that rhyme.
This is useful for automatically generating rhyming sentences, poems, etc. It is very accurate as it uses the pronouncing dictionary, but may not recognise some words, though the CMU dictionary does contain over 140k words.
Install
npm install rhyming-part
Usage
import getRhymingPart from 'rhyming-part';
getRhymingPart('Hello');
getRhymingPart('Below');
getRhymingPart('treat');
getRhymingPart('Would you like a treat?');
getRhymingPart('Sweet');
getRhymingPart('ajhakjhksa');
getRhymingPart('Taxes', { multiple: true });
getRhymingPart('taped', { multiple: true });
getRhymingPart('uahoahja', { multiple: true });
API
getRhymingPart(input, options?)
input
Type: string
Text to retrieve the rhyming part from. If there is more than one word, the last word in the text will be used.
options
Type: object
multiple
Type: boolean
Default: false
Whether to include all unique rhyming parts for every pronunciation of the word.