Skip to main content

A Python wrapper for the goruut phonemization tool

Project description

pygoruut

Getting started

from pygoruut.pygoruut import Pygoruut

pygoruut = Pygoruut()

print(str(pygoruut.phonemize(language="English", sentence="fast racing car")))

# Prints: fˈæst ˈɹeɪsɪŋ kɑː

# Now, convert it back

print(str(pygoruut.phonemize(language="English", sentence="fˈæst ˈɹeɪsɪŋ kɑː", is_reverse=True)))

# Prints: fast racing carr

Uyghur language, our highest quality language

print(str(pygoruut.phonemize(language="Uyghur", sentence="قىزىل گۈل ئاتا")))

# Prints: qɯzɤl gyl ʔɑtɑ

# Now, convert it back

print(str(pygoruut.phonemize(language="Uyghur", sentence="qizil gyl ʔɑtɑ", is_reverse=True)))

# Prints: قىزىل گۈل ئاتا

The quality of translation varies accros the 136 supported languages.

Advanced Use

Multi lingual sentences handling

Use comma (,) separated languages in language (the first language is the preferred language):

print(pygoruut.phonemize(language="English,Slovak", sentence="hello world ahojte not-in-dictionary!!!!"))

# Prints: hɛlˈoʊ wəld aɦɔjcɛ --nˈoʊtˈinnikʃənɑɹɪ!!!!

No punctuation

' '.join([w.Phonetic for w in pygoruut.phonemize(language="English", sentence="hello world!!!!").Words])

Force a specific version

A certain version is frozen, it will translate all words in the same way

from pygoruut.pygoruut import Pygoruut

pygoruut = Pygoruut(version='v0.5.1')

Configure a model download directory for faster startup

For faster startup, the model can be cached in the user-provided directory

from pygoruut.pygoruut import Pygoruut

pygoruut = Pygoruut(writeable_bin_dir='/home/john/')

If you want to cache it in user's home subdir .goruut, use:

from pygoruut.pygoruut import Pygoruut

pygoruut = Pygoruut(writeable_bin_dir='')

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

pygoruut-0.5.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

pygoruut-0.5.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file pygoruut-0.5.1.tar.gz.

File metadata

  • Download URL: pygoruut-0.5.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for pygoruut-0.5.1.tar.gz
Algorithm Hash digest
SHA256 270bc785d41d58a235f8601f585feeee8cfcd802fa5dcc9b9c0dfddb025f89df
MD5 05a16375910e34ae7998ad422ee458a2
BLAKE2b-256 e92089280007cff635b6ffab2f85a863ebd2c1f1a4f013473a6a40a8731a0a40

See more details on using hashes here.

File details

Details for the file pygoruut-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pygoruut-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for pygoruut-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36629f44ce71235168a6196911a61a911a417efcb97d9fc5913b7041e35d4ade
MD5 8a4b7e2fe8c54da9bdef5f3bb3df0112
BLAKE2b-256 4b6fc5115e50eb684b4082763794d4cfebf77d3d15d081e3049cd112ec2fe7e7

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