rhyming-part

1.1.0 • Public • Published

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

/rhyming-part/

    Package Sidebar

    Install

    npm i rhyming-part

    Weekly Downloads

    4

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    4.29 kB

    Total Files

    4

    Last publish

    Collaborators

    • f-a-r-a-z