/lpd

A Python module to read Longman Pronunciation Dictionary

Primary LanguagePythonMIT LicenseMIT

First of all, you need to get the file which name is like “En-En-Longman_Pronunciation.dsl”, size about 33M.

Installation

pip install git+git://github.com/meng89/lpd@master

Usage

as a module

import lpd

lpd.load('/media/data/En-En-Longman_Pronunciation.dsl')

print(lpd.find('excuse'))

# {'noun': ['ɪkˈskjuːs'], 'verb': ['ɪkˈskjuːz']}

as a script

lpd.py excuse --dsl ~/En-En-Longman_Pronunciation.dsl

# {'verb': ['ɪkˈskjuːz'], 'noun': ['ɪkˈskjuːs']}