rhymes-with

1.0.0 • Public • Published

rhymes-with

Determines whether two words rhyme with each other

Uses the cmu-pronouncing-dictionary (~1MB) to determine if two words rhyme.

This has the advantage of being much more accurate than algorithmic methods, but the drawback is that the dictionary contains ~130,000 words, so the results may be limited.

Install

npm install rhymes-with

Usage

import rhymesWith from 'rhymes-with';

rhymesWith('cat', 'hat');
//=> true

rhymesWith('bonnie', 'irani');
//=> true

rhymesWith('aigner', 'ama');
//=> false

rhymesWith('aigner', 'ama', {allPronounciations: true});
//=> true

// words not in dictionary
rhymesWith('pooper', 'scooper');
//=> false

API

rhymesWith(wordA, wordB, options?)

Returns false if either word is not in the dictionary.

wordA and wordB

Type: string

Words to check if they rhyme.

options

Type: object

allPronounciations

Type: bool
Default: false

Whether to check alternative pronounciations of the words to see if there's a rhyme.

Package Sidebar

Install

npm i rhymes-with

Weekly Downloads

5

Version

1.0.0

License

CC0-1.0

Unpacked Size

10.3 kB

Total Files

4

Last publish

Collaborators

  • muhashi