An in-memory syllable count dictionary for North American English derived from the CMU Pronouncing Dictionary.
Project description
pysyllables
An in-memory syllable count dictionary for North American English derived from the CMU Pronouncing Dictionary.
>>> from pysyllables import get_syllable_count
>>> get_syllable_count("fabulous")
3
>>> get_syllable_count("word-that-doesn't-exist")
None
Where do these syllable counts come from?
From the CMU Pronouncing Dictionary, an open-source machine-readable pronunciation dictionary for North American English that contains over 134,000 words and their pronunciations.
By counting the number of lexical stress markers in each word's pronunciation, we can compute the # of syllables in each word. This library ships with a file that maps each word to a syllable count in pysyllables/syllable-counts.txt
How does one generate pysyllables/syllable-counts.txt?
scripts/download_syllable_counts.sh downloads the CMU Pronouncing Dictionary, computes each word's syllable count, and emits pysyllables/syllable-counts.txt.
Should there be a new version of the CMU Pronouncing Dictionary, update the source in scripts/download_syllable_counts.sh.
Contributing
Questions & contributions welcome -- please open an issue or, even better, a PR!
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
Built Distribution
File details
Details for the file pysyllables-1.0.3.tar.gz
.
File metadata
- Download URL: pysyllables-1.0.3.tar.gz
- Upload date:
- Size: 431.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed00747b783d471a5cdf0052e5f2ed36e631df098bd4a876dc1bf62436f9b85d |
|
MD5 | d39dd51b4b46f78f0c6b5296d69b15fb |
|
BLAKE2b-256 | bcbcc3d16807c4160a59a2357be3e65e79fdbd3c77daec70e8c2dc93614e1d72 |
File details
Details for the file pysyllables-1.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: pysyllables-1.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 426.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6dfcc135086e1f041821cdf9a92864514a4547364d334f40b6223b370b30d29 |
|
MD5 | 138b042e6eeb31d663871ce66a1703a6 |
|
BLAKE2b-256 | 58e969f90cdc5880c144e94c54593d0f3b4317446a2c6fd702f59908d1b35c3b |