PYENGLISH2PINYIN
Convert English words to numbered Pinyin(mandarin/chinese phonetic system) through CMUdict IPA.
Input and Output Examples
English word to Pinyin (12 verified examples)
| English Word | Pinyin Output |
|---|---|
| record | ruo5 kao1 r5 de5 |
| communication | ka5 mu5 yu4 na5 kui1 sha5 en5 |
| in | yi5 en5 |
| securing | xi5 ke5 yu1 rui5 eng5 |
| prime | po5 ruo1 mu5 |
| foreign | fan1 ruo5 en5 |
| aldinger | ao1 ao5 di5 eng5 r5 |
| engleman | yi1 eng5 a5 ao5 ma5 en5 |
| legacy | lai1 ga5 xi5 |
| blotting | bo5 la1 ti5 eng5 |
| english | yi1 eng5 ge5 li5 shi5 |
| banana | ba5 nai1 na5 |
IPA to Pinyin
| IPA Input | Pinyin Output |
|---|---|
| AE2 P L AH0 K EY1 SH AH0 N | ai4 po5 la5 kui1 sha5 en5 |
| S IH0 K Y UH1 R IH0 NG | xi5 ke5 yu1 rui5 eng5 |
| L EH1 G AH0 S IY0 | lai1 ga5 xi5 |
This is especially helpful when training FastSpeech2 speech synthesis for mixed Chinese and English text, because it reduces dataset preparation effort for text normalization and phoneme alignment while keeping pronunciation labels consistent.
Install
pip install pyenglish2pinyin
Usage
from english2pinyin import english2ipa, english2pinyin, ipa2pinyin
print(english2ipa("application"))
# AE2 P L AH0 K EY1 SH AH0 N
print(english2pinyin("application"))
# ai4 po5 la5 kui1 sha5 en5
print(ipa2pinyin("S IH0 K Y UH1 R IH0 NG"))
# xi5 ke5 yu1 rui5 eng5
API
english2ipa(word, dict_path=None)->str | Noneenglish2pinyin(word, dict_path=None, throw_if_missing=False)->stripa2pinyin(ipa_text)->str
Development
pip install -e .[dev]
pytest
Metadata
Release files for pyenglish2pinyin 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyenglish2pinyin-0.1.3.tar.gz | 928.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyenglish2pinyin-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / pyenglish2pinyin-0.1.3.tar.gz
| Download URL | pyenglish2pinyin-0.1.3.tar.gz |
|---|---|
| Size | 928.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca613fc800e9e58e37221f991266caee88888068a683622abc5a663c57355225
|
|
BLAKE2b-256 checksum How to use checksums |
f0e1025d3062fc452f02eff737217c14447d140b52bece2e7afdff23be71ae8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / pyenglish2pinyin-0.1.3-py3-none-any.whl
| Download URL | pyenglish2pinyin-0.1.3-py3-none-any.whl |
|---|---|
| Size | 950.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af6fad5bda8324171561ceb0b1f126f963eb442aa3010e3737a007e52f110362
|
|
BLAKE2b-256 checksum How to use checksums |
ea78e90e99b963206fe6a4834fa9ceeef72ad0d8a0e92ca88d0b8eeba3ad15ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|