https://github.com/arverma/hindixlit
Transliteration models for Roman to Devanagari language
https://github.com/arverma/hindixlit
hindi indicxlit python-library roman-to-devnagari transalitration transliterate-hindi
Last synced: 3 months ago
JSON representation
Transliteration models for Roman to Devanagari language
- Host: GitHub
- URL: https://github.com/arverma/hindixlit
- Owner: arverma
- License: mit
- Created: 2025-06-26T04:10:17.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-27T03:42:19.000Z (4 months ago)
- Last Synced: 2025-07-29T22:19:17.073Z (3 months ago)
- Topics: hindi, indicxlit, python-library, roman-to-devnagari, transalitration, transliterate-hindi
- Language: Python
- Homepage: https://pypi.org/project/hindi-xlit/
- Size: 45.8 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Hindi Transliteration Library
A Python library for transliterating English text to Hindi using AI4Bharat's model. This library provides a simple interface for converting English words to their Hindi (Devanagari) equivalents.
## Features
- Returns multiple transliteration candidates, default is 3
- Interactive command-line interface
## Installation
```bash
pip install hindi-xlit
```
## Usage
### Basic Usage
```python
from hindi_xlit import HindiTransliterator
# Initialize the transliterator
transliterator = HindiTransliterator()
# Transliterate a single word
word = "namaste"
candidates = transliterator.transliterate(word)
print(f"Transliteration candidates for '{word}':")
for i, candidate in enumerate(candidates, 1):
print(f"{i}. {candidate}")
# Transliterate multiple words
words = ["hello", "world"]
results = transliterator.transliterate_batch(words)
for word, candidates in zip(words, results):
print(f"\nTransliteration candidates for '{word}':")
for i, candidate in enumerate(candidates, 1):
print(f"{i}. {candidate}")
```
### Command Line Interface
After installing the package (e.g., via pip from PyPI), you can use the command line interface:
```bash
hindi-xlit [topk]
```
- ``: The word in Roman script to transliterate (required)
- `[topk]`: (Optional) Number of transliteration candidates to return (default: 3)
**Examples:**
```bash
hindi-xlit namaste
# Output:
# Transliteration candidates for 'namaste':
# 1. नमस्ते
# 2. नमसते
# 3. नामसते
hindi-xlit hello 5
# Output:
# Transliteration candidates for 'hello':
# 1. हेलो
# 2. हैलो
# 3. हेलों
# 4. हिलो
# 5. हीलो
```
If you run the command without arguments, it will show usage instructions.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
This library uses the transliteration model from [AI4Bharat](https://github.com/AI4Bharat/IndicXlit).
See [CHANGELOG.md](./CHANGELOG.md) for release notes.