Skip to main content

Library to load and save pronunciation dictionaries (any language).

Project description

pronunciation-dictionary

PyPI PyPI MIT

Library to load and save pronunciation dictionaries (any language).

Features

  • Load dictionary from file or URL
    • Parsing of
      • line comments
      • pronunciation comments
      • numbers indicating alternative pronunciations for words
      • weights
    • Multiprocessing for faster deserialization
  • Save dictionary to file
    • including numbers for alternative pronunciations
    • include weights
    • set word/weight/pronunciation separator
  • Select pronunciation via
    • weight
    • highest/lowest weight
    • first/last
    • random
  • Get phoneme set

Roadmap

  • Adding tests

Example dictionaries and deserialization arguments

Excerpt from CMU (as example)

a.d. EY2 D IY1
a.m. EY2 EH1 M
a.s EY1 Z
aaa T R IH2 P AH0 L EY1
aaberg AA1 B ER0 G
aachen AA1 K AH0 N
aachener AA1 K AH0 N ER0
aaker AA1 K ER0
aalborg AO1 L B AO0 R G # place, danish
aalborg(2) AA1 L B AO0 R G

Installation

pip install pronunciation-dictionary --user

Usage

from pronunciation_dictionary import load_dict, save_dict, MultiprocessingOptions, DeserializationOptions, SerializationOptions

Citation

If you want to cite this repo, you can use this bibtex-entry:

@misc{tspd22,
  author = {Taubert, Stefan},
  title = {pronunciation-dictionary},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/stefantaubert/pronunciation-dictionary}}
}

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

pronunciation-dictionary-0.0.4.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

pronunciation_dictionary-0.0.4-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

Supported by

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