Lightweight Japanese text-to-IPA phoneme converter extracted from misaki
Project description
misaki-ja-lightning ⚡
Lightweight Japanese text-to-IPA phoneme converter extracted from the misaki library. This package contains only the Japanese G2P (grapheme-to-phoneme) functionality with minimal dependencies.
Features
- 🇯🇵 Convert Japanese text (hiragana, katakana, kanji) to IPA phonemes
- 🔢 Convert numbers to Japanese kana
- ⚡ Lightning-fast with minimal dependencies
- 🎯 Focused on Japanese language only
- 🔧 Uses
pyopenjtalkfor accurate phoneme conversion
Installation
pip install misaki-ja-lightning
Usage
Basic G2P Conversion
from misaki_ja_lightning import JAG2P
# Initialize the converter
g2p = JAG2P()
# Convert Japanese text to IPA phonemes
text = "こんにちは、世界"
phonemes, tokens = g2p(text)
print(phonemes) # IPA phoneme string with pitch information
Number to Kana Conversion
from misaki_ja_lightning import Convert, ConvertKanji
# Convert Arabic numbers to Japanese
result = Convert(12345, 'hiragana')
print(result) # いちまんにせんさんびゃくよんじゅうご
# Convert to kanji
result = Convert(12345, 'kanji')
print(result) # 一万二千三百四十五
# Convert to romaji
result = Convert(12345, 'romaji')
print(result) # ichi man ni sen san byaku yon juu go
# Supported formats: 'hiragana', 'kanji', 'romaji'
# Note: 'katakana' is not supported in num2kana module
# Convert kanji numbers back to Arabic
number = ConvertKanji("一万二千三百四十五")
print(number) # 12345
Token-level Processing
from misaki_ja_lightning import JAG2P
g2p = JAG2P()
phonemes, tokens = g2p("今日は良い天気ですね")
for token in tokens:
print(f"Text: {token.text}")
print(f"Phonemes: {token.phonemes}")
print(f"Tag: {token.tag}")
print(f"Pitch: {token._.pitch}")
print("---")
What's Included
This lightweight package includes only:
ja.py- Japanese G2P converter using pyopenjtalknum2kana.py- Number to Japanese kana convertertoken.py- Token data structure
Differences from Original Misaki
- ✅ Japanese-only (removed other languages)
- ✅ Removed
cutletdependency - ✅ Removed
addictdependency - ✅ Simplified token structure
- ✅ Only
pyopenjtalkversion (no cutlet option) - ✅ Minimal dependencies
Requirements
- Python >= 3.8
- pyopenjtalk >= 0.3.0
License
MIT License (inherited from original misaki library)
Credits
This package is extracted from misaki by hexgrad. All credit for the original implementation goes to the misaki authors.
The num2kana module is based on Convert-Numbers-to-Japanese by Greatdane (MIT License).
Related Projects
- misaki - Full multilingual G2P library
- Kokoro-82M - Text-to-speech model
- pyopenjtalk - Japanese text processing
Use Cases
Perfect for:
- Text-to-speech applications
- Japanese language learning tools
- Phoneme-based synthesis
- Lightweight Japanese text processing
Support
For issues and questions, please visit the GitHub Issues page.
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
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
File details
Details for the file misaki_ja_lightning-0.1.0.tar.gz.
File metadata
- Download URL: misaki_ja_lightning-0.1.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1a509c74526327ee7534fbaa95ae90a09275a78242af103e04ac17fc8e68a8
|
|
| MD5 |
a14cf10f5e389df6ad7f77319bd99d0a
|
|
| BLAKE2b-256 |
0a59f6a60ed4b726e38340ad75b5dcf86b4196554fea182ad7dd55a8293b6ac3
|
File details
Details for the file misaki_ja_lightning-0.1.0-py3-none-any.whl.
File metadata
- Download URL: misaki_ja_lightning-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c3a3dae1ff19e4996e3b946a9563bf720d4f59d8dbbf77ccba6e5d39947d9ac
|
|
| MD5 |
ae50fc4989f4788c474afea02acfaca6
|
|
| BLAKE2b-256 |
81888c5582ed51dd4abca86d08f19e9683de61a1017c7dcbe7f4bda65572a7a5
|