Skip to content

Python parser for CMUDict files. It returns ARBAbet and IPA transciption of dictionary words.

License

Notifications You must be signed in to change notification settings

stefantaubert/cmudict-parser

Repository files navigation

cmudict-parser: ARPAbet and IPA for CMU Dictionary

Python Python

Python parser for CMUDict files. It returns ARBAbet and IPA transciption of dictionary words.

Installation

python3.8 -m pip install pipenv
python3.8 -m pipenv install --ignore-pipfile

Usage

from cmudict_parser import get_dict

cmudict = get_dict(
    download_folder="/tmp"
)

print(cmudict.get_all_arpa("to"))
# ['T UW1', 'T IH0', 'T AH0']

print(cmudict.get_all_ipa("to"))
# ['tˈu', 'tɪ', 'tʌ']

print(cmudict.get_first_ipa("to"))
# tˈu

Development

apt install python3-lib2to3
python3.8 -m pip install pipenv
python3.8 -m pipenv install --dev

Add to other project

In the destination project run:

# if not already done:
python3.8 -m pip install pipenv
# add reference
python3.8 -m pipenv install -e git+https://github.com/stefantaubert/cmudict-parser.git@master#egg=cmudict_parser

Notes

About

Python parser for CMUDict files. It returns ARBAbet and IPA transciption of dictionary words.

Topics

Resources

License

Stars

Watchers

Forks

Languages