Convert text to IPA for English and French
Project description
Installation:
Windows
python -m pip install text2ipa
macOS
sudo pip3 install text2ipa
Linux
pip install text2ipa
Features
- Convert English text to IPA using the toPhonetic
- Three options Language English UK, English US and French
Examples
Example 1: Convert a text
Function:
get_IPA()
: Converting a text to IPA with the following parameters
Parameters:
text
: The text you want to convert to IPAlanguage
: Choose between English US, English UK and French ('am', 'br' or 'fr')proxy
: Optional parameter
For instance:
from text2ipa import get_IPA
# Convert 'hello world' to English US International Alphabet
text = 'hello world'
language = 'am'
ipa = get_IPA(text, language)
# Convert 'je parle un peu français' to IPA
text = 'je parle un peu français'
language = 'fr'
fr_ipa = get_IPA(text, language)
print(ipa)
print(fr_ipa)
>> həˈloʊ wɜrld
>> ʒə paʀle œ̃ pø fʀɑ̃̃sɛ
Example 2: Convert a bulk
Function:
get_IPAs()
: Convert the list of texts to IPA return the list of IPAs
Parameters:
bulk
: The list of text want to convert to IPAlanguage
: Choose between English US and English UK ('am', 'br' or 'fr')proxy
: Optional parameter
For instance:
from text2ipa import get_IPAs
bulk = ['how are you?','how it\'s going?','that\'s good']
language = 'br'
# Convert a list of text to English UK IPA
IPAs = get_IPAs(bulk,language)
for ipa in IPAs:
print(ipa)
>> haʊ ɑː juː?
>> haʊ ɪts ˈgəʊɪŋ?
>> ðæts gʊd
Log Changes
V1.0.0 : Create new with 2 functions get_IPA()
and get_IPAs()
V1.2.0 : Update comment and guideline in functions, fixed ERROR for setup with the other Python versions
V1.3.0 : Fixed MISSING install requires and update information for Python versions
V1.4.0 : Update building & testing for this package
V1.4.1 : Fixed Error Import get_IPA()
and get_IPAs
V2.0.1 : New feature working with French
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
text2ipa-2.0.1rc3.tar.gz
(9.0 kB
view hashes)
Built Distribution
Close
Hashes for text2ipa-2.0.1rc3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9efa658de9b547307375380fa4f9711bda88e401b928e232c667ced9497d4fa0 |
|
MD5 | b1ef755952238809a1004ee3fe682dcc |
|
BLAKE2b-256 | a13aa0b6bbc63f4b25890733f672824ce2fe6f9df8194bbc580e140a8d161ca4 |