A Python wrapper for the goruut phonemization tool
Project description
pygoruut
Getting started
from pygoruut.pygoruut import Pygoruut
pygoruut = Pygoruut()
print(pygoruut.phonemize(language="English", sentence="fast racing car"))
# Prints:
# PhonemeResponse(Words=[
# Word(CleanWord='fast', Phonetic='fˈæst'),
# Word(CleanWord='racing', Phonetic='ˈɹeɪsɪŋ'),
# Word(CleanWord='car', Phonetic='kɑː')])
# Now, convert it back
print(pygoruut.phonemize(language="English", sentence="fˈæst ˈɹeɪsɪŋ kɑː", is_reverse=True))
# Prints:
# PhonemeResponse(Words=[
# Word(CleanWord='fˈæst', Phonetic='fast'),
# Word(CleanWord='ˈɹeɪsɪŋ', Phonetic='racing'),
# Word(CleanWord='kɑː', Phonetic='carr')])
Uyghur language, our highest quality language
print(pygoruut.phonemize(language="Uyghur", sentence="قىزىل گۈل ئاتا"))
# Prints:
# PhonemeResponse(Words=[
# Word(CleanWord='قىزىل', Phonetic='qizil'),
# Word(CleanWord='گۈل', Phonetic='gyl'),
# Word(CleanWord='ئاتا', Phonetic='ʔɑtɑ')])
# Now, convert it back
print(pygoruut.phonemize(language="Uyghur", sentence="qizil gyl ʔɑtɑ", is_reverse=True))
# Prints:
# PhonemeResponse(Words=[
# Word(CleanWord='qizil', Phonetic='قىزىل'),
# Word(CleanWord='gyl', Phonetic='گۈل'),
# Word(CleanWord='ʔɑtɑ', Phonetic='ئاتا')])
The quality of translation varies accros the 85 supported languages.
Advanced Use
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='0.4.0')
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/')
Project details
Release history Release notifications | RSS feed
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.4.0.tar.gz
(18.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pygoruut-0.4.0-py3-none-any.whl
(15.7 kB
view details)
File details
Details for the file pygoruut-0.4.0.tar.gz.
File metadata
- Download URL: pygoruut-0.4.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6062dca586d9774cf0e0bde039d22a463976c557735537844647c4685714e78
|
|
| MD5 |
1135acc031751abdabfbb42ab4ac21a2
|
|
| BLAKE2b-256 |
dd0da52a1a13f74f62c135c176d8966525cd97b3273be59e29d22b05a7653025
|
File details
Details for the file pygoruut-0.4.0-py3-none-any.whl.
File metadata
- Download URL: pygoruut-0.4.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7b2daf34d0168d745833c3e2ab3662cde55c50f1ed7f5703c624e63e94d6225
|
|
| MD5 |
c30dce4edfe87cf42a22df40622351db
|
|
| BLAKE2b-256 |
f65fc8d0b891cf222fda0e823e47368ca0afcc29a3b48ddcf78025c86027916d
|