Metadata-Version: 2.4
Name: eng-to-ru-transcriber
Version: 0.3.2
Summary: automatic english-to-cyrillic text transcriber
Author: kodovy-pesets
License: MIT
Project-URL: Homepage, https://github.com/Isyarname/eng-to-ru-transcriber
Project-URL: Repository, https://github.com/Isyarname/eng-to-ru-transcriber
Project-URL: Changelog, https://github.com/Isyarname/eng-to-ru-transcriber/blob/main/docs/CHANGELOG.md
Project-URL: Issues, https://github.com/Isyarname/eng-to-ru-transcriber/issues
Keywords: transliteration,english,russian
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Natural Language :: English
Classifier: Natural Language :: Russian
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# Practical English-Russian Transcription

[Читать на русском языке](https://github.com/Isyarname/eng-to-ru-transcriber/blob/main/README.ru.md)

A lightweight Python library for quick and deterministic practical transcription of English words using the Russian alphabet.

## Why this exists

**This library is built for:**
- **Adapting slang and neologisms** (e.g., *crush*, *vibe*, *hype*).
- **Transcribing names, usernames, and brand names.**

Modern translation tools are powerful, but they are overkill for simple tasks:
- **Cloud APIs** (like Google Translate or DeepL) require an internet connection and have rate limits.
- **Neural networks** (even local ones) are heavy, slow to initialize, and can produce unpredictable results.

Sometimes you just need to instantly write English words, names, or slang using the Russian alphabet without waiting for models to load.

## Features

- **Practical transcription:** adapts IPA pronunciation to match Russian orthography rules, rather than just letter-by-letter replacement.
- **Vowel length indication:** long vowels are marked with an acute accent (e.g., `и́`, `у́`), preserving phonetic accuracy.
- **Zero dependencies & 100% offline:** no heavy ML models or cloud APIs. Works instantly.
- **Deterministic:** the same word always yields the exact same result.
- **Hybrid engine:** uses a built-in 120k+ word dictionary for common words and a fast rule-based engine for everything else.
- **Custom vocabulary:** easily teach the library how to transcribe your specific character names, brands, or terms.

## Installation

Requires Python 3.9 or higher.

```bash
pip install eng-to-ru-transcriber
```

## Usage

### Basic Example

```python
from eng_to_ru_transcriber import Transcriber

t = Transcriber()
print(t.transcribe("Hello, URL!")) 
# → халоу, ю́а́эл!
```

*Abbreviations (like URL) are automatically detected and read letter-by-letter. The acute accent (e.g., `ю́`) marks vowel length, not stress.*

### Custom Vocabulary

You can easily override the pronunciation of specific words (names, brands, or specific slang) by passing a dictionary:

```python
from eng_to_ru_transcriber import Transcriber

# Teach the transcriber your custom terms
custom_vocabulary = {
    "python": "ˈpaɪθɑn",
    "kubernetes": "ˌk(j)uːbəˈnɛtɪs"
}

t = Transcriber(custom_vocabulary=custom_vocabulary)
print(t.transcribe("I love Python and Kubernetes"))
```

## Testing

```bash
pip install -e ".[dev]"
python -m pytest
```

## Data Sources

English IPA data is derived from [open-dict-data/ipa-dict](https://github.com/open-dict-data/ipa-dict) (MIT License, Copyright © 2016 dohliam).

## License

MIT
