Giter Site home page Giter Site logo

node-rhyme's Introduction

rhyme-plus

A rhyming dictionary for your node.js.

example

var rhyme = require('rhyme-plus');
rhyme(function (r) {
    console.log(r.rhyme('bed').join(' '));
});

output:

$ node examples/bed.js
BLED BREAD BRED DEAD DREAD DRED DREDD ED FED FLED FREAD FRED FREDA GED HEAD
JED LEAD LED MED NED NEDD PLED READ READE RED REDD SAID SCHWED SFFED SHEAD
SHED SHEDD SHRED SLED SLEDD SPED SPREAD STEAD SWED SZWED TED THREAD TREAD
WED WEDD WEHDE ZED

example2

var rhyme = require('rhyme-plus');
rhyme(function (r) {
    console.log(JSON.stringify(r.findRhymes(['bed', 'read', 'feed'])));
});

output:

$ node examples/bed.js
[['BED', 'READ'], ['READ', 'FEED']]

methods

rhyme(callback)

Read in the rhyme database. Callback function gets called with the rhyme handle.

rhyme handle

r.rhyme(word)

Returns all rhymes for word.

r.pronounce(word)

Shows how to pronounce word using CMU's pronouncing dictionary phonemes .

r.syllables(word)

Counts the syllables in word using the phonemes in r.pronounce and some heuristics.

r.alliteration(word)

Returns alliterative words, which begin with the same syllable as word.

r.doRhyme(word1, word2)

Returns whether these words could rhyme (for example: read and feed, read and fed).

r.findRhymes(words)

Searches the words array for pairs of rhyming words. Returns an array of pairs.

installation

Using npm:

npm install rhyme-plus

testing

Download rhyming dictionary using cd data && ./fetch.sh

node-rhyme's People

Contributors

mapmeld avatar jfhbrook avatar httpnick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.