Automatically convert plain text into phonemes (US English pronunciation) and syllabify
Project description
Syllabify
Automatically convert plain text into phonemes (US English pronunciation) and syllabify.
Modified from the repository set up by Andrew Caines with some key changes, itemised below:
- Environment management using Poetry
- Python 3.10+ compatibility
- Easy to access class and function interfaces
- Use up-to-date cmudict versioned by python-cmudict
Set up
Requires Python 3 (Anthony Evans used Python 2: if that's what you prefer, see his repo).
pip install syllabify
Usage
Package interface
from syllabify import syllabify
word = syllabify("linguistics")
print(word)
L IH0 NG {onset: L, nucleus: IH0, coda: NG}
G W IH1 {onset: GW, nucleus: IH1, coda: empty}
S T IH0 K S {onset: ST, nucleus: IH0, coda: KS}
You can get the onset, nucleus, and coda of each syllable:
from syllabify import syllabify
word = syllabify("linguistics")
for syllable in word.syllables:
print(f"Onset: {syllable.onset}")
print(f"Nucleus: {syllable.nucleus}")
print(f"Coda: {syllable.coda}")
Onset: L
Nucleus: IH0
Coda: NG
Onset: GW
Nucleus: IH1
Coda: empty
Onset: ST
Nucleus: IH0
Coda: KS
Command line interface
One word at a time:
syllabify linguistics
📝 Input: linguistics
🔤 Syllabification:
LIH0NG [L.IH0.NG] | ˈGWIH1 [GW.IH1.∅] | STIH0KS [ST.IH0.KS]
📖 Legend:
[onset.nucleus.coda] = syllable structure
∅ = empty position
ˈ = primary stress
ˌ = secondary stress
| = syllable boundary
Or several (space-separated):
syllabify colorless green ideas
📝 Input: colorless green ideas
🔤 Syllabification:
ˈKAH1 [K.AH1.∅] | LER0 [L.ER0.∅] | LAH0S [L.AH0.S]
ˈGRIY1N [GR.IY1.N]
AY0 [∅.AY0.∅] | ˈDIY1 [D.IY1.∅] | AH0Z [∅.AH0.Z]
📖 Legend:
[onset.nucleus.coda] = syllable structure
∅ = empty position
ˈ = primary stress
ˌ = secondary stress
| = syllable boundary
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 syllabify-0.5.0.tar.gz.
File metadata
- Download URL: syllabify-0.5.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d86fdbed2f2ed7d10f2461a89a4429bd8702b035fac2c6cf346e5ac133ee54f0
|
|
| MD5 |
49195eefbff32e98141a057a673ede59
|
|
| BLAKE2b-256 |
90f1d311fd065c48112debde303a9c3d3c9cfa4041dea306e960220d5a87721a
|
Provenance
The following attestation bundles were made for syllabify-0.5.0.tar.gz:
Publisher:
python-publish.yml on eoleedi/syllabify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
syllabify-0.5.0.tar.gz -
Subject digest:
d86fdbed2f2ed7d10f2461a89a4429bd8702b035fac2c6cf346e5ac133ee54f0 - Sigstore transparency entry: 923991444
- Sigstore integration time:
-
Permalink:
eoleedi/syllabify@6b525a423ffe311a7383972e4d159c268d971b5d -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/eoleedi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6b525a423ffe311a7383972e4d159c268d971b5d -
Trigger Event:
release
-
Statement type:
File details
Details for the file syllabify-0.5.0-py3-none-any.whl.
File metadata
- Download URL: syllabify-0.5.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe3c82a11150ba4e6c190abb605946beefab709412e35a25b38eb2410615df13
|
|
| MD5 |
b1f01518f1b7cb90651203d70022ccd9
|
|
| BLAKE2b-256 |
1ae6b186df5957ac669fd0172582a5663f2a5fc71c944a9d55f91af64e631503
|
Provenance
The following attestation bundles were made for syllabify-0.5.0-py3-none-any.whl:
Publisher:
python-publish.yml on eoleedi/syllabify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
syllabify-0.5.0-py3-none-any.whl -
Subject digest:
fe3c82a11150ba4e6c190abb605946beefab709412e35a25b38eb2410615df13 - Sigstore transparency entry: 923991448
- Sigstore integration time:
-
Permalink:
eoleedi/syllabify@6b525a423ffe311a7383972e4d159c268d971b5d -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/eoleedi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6b525a423ffe311a7383972e4d159c268d971b5d -
Trigger Event:
release
-
Statement type: