Skip to main content

A versioned python wrapper package for The CMU Pronouncing Dictionary data files.

Project description

CMUdict: Python wrapper for cmudict

Latest PyPI version GitHub Workflow Status

CMUdict is a versioned python wrapper package for The CMU Pronouncing Dictionary data files. The main purpose is to expose the data with little or no assumption on how it is to be used.

Installation

cmudict is available on PyPI. Simply install it with pip:

pip install cmudict

Usage

The cmudict data set includes 4 data files: cmudict.dict, cmudict.phones, cmudict.symbols, and cmudict.vp. See The CMU Pronouncing Dictionary for details on the data. Chances are, if you're here, you already know what's in the files.

Each file can be accessed through three functions, one which returns the raw (string) contents, one which returns a binary stream of the file, and one which does minimal processing of the file into an appropriate structure:

>>> import cmudict

>>> cmudict.dict() # Compatible with NLTK
>>> cmudict.dict_string()
>>> cmudict.dict_stream()

>>> cmudict.phones()
>>> cmudict.phones_string()
>>> cmudict.phones_stream()

>>> cmudict.symbols()
>>> cmudict.symbols_string()
>>> cmudict.symbols_stream()

>>> cmudict.vp()
>>> cmudict.vp_string()
>>> cmudict.vp_stream()

Three additional functions are included to maintain compatibility with NLTK: cmudict.entries(), cmudict.raw(), and cmudict.words(). See the nltk.corpus.reader.cmudict documentation for details:

>>> cmudict.entries() # Compatible with NLTK
>>> cmudict.raw() # Compatible with NLTK
>>> cmudict.words() # Compatible with NTLK

And finally, the license for the cmudict data set is available as well:

>>> cmudict.license_string() # Returns the cmudict license as a string

Credits

Built on or modeled after the following open source projects:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmudict-1.0.33.tar.gz (935.5 kB view details)

Uploaded Source

Built Distribution

cmudict-1.0.33-py3-none-any.whl (939.4 kB view details)

Uploaded Python 3

File details

Details for the file cmudict-1.0.33.tar.gz.

File metadata

  • Download URL: cmudict-1.0.33.tar.gz
  • Upload date:
  • Size: 935.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for cmudict-1.0.33.tar.gz
Algorithm Hash digest
SHA256 f4c463c8406a2414f9f9058d60e45a7ce69081892ce27102dc91dc1bc6f92115
MD5 a6e845be97c700c4da60ed4cb06b8cc8
BLAKE2b-256 343268e3162cb1d6b1678811893bd26c9d46ae0a3f6ada8737868c70b1d30785

See more details on using hashes here.

File details

Details for the file cmudict-1.0.33-py3-none-any.whl.

File metadata

  • Download URL: cmudict-1.0.33-py3-none-any.whl
  • Upload date:
  • Size: 939.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for cmudict-1.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 a9e9e7067caaa71a10dd10f3a4821223840529f00961d65163c9041c76759953
MD5 5c577fd1579cd2145096ff2c76c54280
BLAKE2b-256 ecb72b227c35949f33a0986a18a0e4830751254e7338062b5b1f10255bca9e21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page