Skip to main content

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

Project description

Latest PyPI version Latest Travis CI build status Latest Codacy Coverage Report

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

You can also install it from source:

$ git clone https://github.com/prosegrinder/python-cmudict.git
Cloning into 'python-cmudict'...
...

$ cd python-cmudict
$ git submodule update --init --recursive
Submodule 'cmudict/data' (https://github.com/cmusphinx/cmudict.git) registered for path 'cmudict/data'...
...

$ python setup.py install
...

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: cumdict.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-0.4.2.tar.gz (936.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmudict-0.4.2-py2.py3-none-any.whl (938.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: cmudict-0.4.2.tar.gz
  • Upload date:
  • Size: 936.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for cmudict-0.4.2.tar.gz
Algorithm Hash digest
SHA256 19a96de1eff8a055a5a070a754fab268f31ffb2b39d702e005636f36bcbdaf8a
MD5 a791c6ba05c7dd9fdeae0b97f7481c83
BLAKE2b-256 5f7c4e9aa881aaed5478dc49aab18b8d50fe60bd2e83e6c5aa86cb52bca1a77b

See more details on using hashes here.

File details

Details for the file cmudict-0.4.2-py2.py3-none-any.whl.

File metadata

  • Download URL: cmudict-0.4.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 938.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for cmudict-0.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 96264dedd7dc95cd903242d75ea7869e3fe3a8b2dae0fda41f90d455cb73ff17
MD5 1252f4778fac549ea6c9112181098646
BLAKE2b-256 42bc606843d7cfe4d82f5a21fc46d1ae8e364ac20c57e68d1ec4190bce4f2734

See more details on using hashes here.

Supported by

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