Metadata-Version: 2.4
Name: pygoruut
Version: 0.6.1
Summary: A Python wrapper for the goruut phonemization tool
Home-page: https://github.com/neurlang/pygoruut
Author: Neurlang Project
Author-email: Neurlang Project <77860779+neurlang@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2024 neurlang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/neurlang/pygoruut
Keywords: goruut,phonemization,tts
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# pygoruut

## Getting started

```python
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 car

```

### Uyghur language, our highest quality language

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

# Prints: qizil 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):

```python
print(pygoruut.phonemize(language="English,Slovak", sentence="hello world ahojte notindictionary!!!!"))

# Prints: həlˈoʊ wəld aɦɔjcɛ nɔtɪndɪktˈɪoʊŋɑɹi!!!!
```

### Numerics handling (English, Arabic)

```python
print(str(pygoruut.phonemize(language="English", sentence="100 bottles")))

# Prints: wæn ˈhʌndəd bˈɑtəlz
```

### Homograph handling (English)

```python
print(str(pygoruut.phonemize(language="English", sentence="He dove into the pool to join the dove")))

# Prints: hˈi 'doʊv ˈɪntu ðə pˈul tə dʒˈɔɪn ðə 'dʌv
```

### No punctuation

```python
' '.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 forever

```python
from pygoruut.pygoruut import Pygoruut

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

```

### Configure a model download directory for faster startup

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

```python
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:

```python
from pygoruut.pygoruut import Pygoruut

pygoruut = Pygoruut(writeable_bin_dir='')
```
