Giter Club home page Giter Club logo

pronouncingjs's Introduction

pronouncing-js

A simple interface to the CMU Pronouncing Dictionary. By Allison Parrish.

This module is a work in progress (obviously).

Installation

$ npm install aparrish/pronouncingjs

Or if you're using the browserified version, download pronouncing-browser.js from the build directory and include it using a <script> tag:

<script src="pronouncing-browser.js"></script>

Usage

This library has feature parity with the Pronouncing Python module. All of the examples in the Tutorial and Cookbook for the Python module also work in Javascript, though the functions in pronouncing.js use camelCase instead of underscores (e.g., Python's search_stresses becomes searchStresses in Javascript).

Use the module in Node like so:

> var pronouncing = require('pronouncing');
undefined
> pronouncing.phonesForWord("adverse")
[ 'AE0 D V ER1 S', 'AE1 D V ER2 S', 'AE2 D V ER1 S' ]
> pronouncing.syllableCount(pronouncing.phonesForWord("adverse")[0])
2
> pronouncing.rhymes("sinking")
[ 'blinking',
	'drinking',
	'linking',
	'plinking',
	'rethinking',
	'shrinking',
	'stinking',
	'thinking',
	'unthinking',
	'winking' ]
> pronouncing.search("^S K R AE1")
[ 'scrabble',
	'scragg',
	'scraggle',
	'scraggly',
	... output omitted for brevity ...
	'scraps',
	'scratching',
	'scratchy',
	'skramstad' ]
> pronouncing.stresses(pronouncing.phonesForWord("snappiest")[0])
'102'
> pronouncing.searchStresses("^00[12]00[12]$")
[ 'neopositivist', 'undercapitalize', 'undercapitalized' ]

A browserified version of the library is in build. Check demo/index.html for an example of how it works!

License

Code in this module is distributed under an MIT license. The CMU pronouncing dictionary itself is included with this module, but has its own license; check the CMU Pronouncing Dictionary page for more information.

Acknowledgements

This package was originally developed as part of my Spring 2015 research fellowship at ITP. Thank you to the program and its students for their interest and support!

pronouncingjs's People

Contributors

aparrish avatar coleww avatar matthewhudson 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.