1.1.0 • Published 5 years ago

rhyming-part v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

rhyming-part Build Status

Get the part of a word that rhymes with other words

Uses the CMU Pronouncing Dictionary (4MB) 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.

Install

$ npm install rhyming-part

Usage

const rhymingPart = require('rhyming-part');

rhymingPart('Hello');
//=> 'OW1'

rhymingPart('Below');
//=> 'OW1'

rhymingPart('treat');
//=> 'IY1 T'

rhymingPart('Would you like a treat?');
//=> 'IY1 T'

rhymingPart('Sweet');
//=> 'IY1 T'

rhymingPart('ajhakjhksa');
//=> ''

rhymingPart('Taxes', {multiple: true});
//=> ['AE1 K S AH0 Z', 'AE1 K S IH0 Z']

rhymingPart('taped', {multiple: true});
//=> ['EY1 P T']

rhymingPart('uahoahja', {multiple: true});
//=> []

API

rhymingPart(input, options)

input

Type: string

The word to get the rhyming part from. Uses the last word from the input.

options

Type: object

multiple

Type: boolean Default: false

If true, returns an array of unique rhyming parts for all pronounciations of the word.

License

MIT © Faraz