Skip to main content

Package to convert between transcription standards

Project description

Convert Phonetic Alphabets

Python package for converting phonetic or phonemic transcriptions from Nofabet to IPA and X-SAMPA, and from X-SAMPA to IPA (original code from https://github.com/peresolb/sampa_to_ipa).

Installation

pip install convert-pa

Usage

from convert_pa import nofabet_to_ipa, nofabet_to_sampa, sampa_to_ipa

# Convert from Nofabet
nofabet_transcription = "B IH2 L IH0 H EE0 T S AEH0 R S T AH3 T N IH0 NG G AX0 N S"

# to IPA
print(nofabet_to_ipa(nofabet_transcription))
# '"bɪ.lɪ.heːt.sær.ˌstɑt.nɪŋ.gəns'

# to X-SAMPA 
print(nofabet_to_sampa(nofabet_transcription))
# '""bI$lI$he:t$s{r$%stAt$nIN$g@ns'

# Convert from X-SAMPA to IPA
sampa_transcription = '""On$d@$%lE*u0s'
print(sampa_to_ipa(sampa_transcription))
# "ɔn.də.ˌlæ͡ʉs

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

convert_pa-0.1.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

convert_pa-0.1.0-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page