This is a small personal project that plays with English phonotactics.
It generates random phoneme sequences and simple syllables using Python.
The current version adds a basic Sonority Sequencing Principle (SSP):
- onsets: sonority goes up towards the vowel
- codas: sonority goes down away from the vowel
It’s just a toy model, not a full description of RP.
- Generates random syllables with onset, nucleus, and coda
- Uses a simple sonority scale for English consonants
- Excludes impossible things like /ŋ/ in onset position
- Uses only Python’s built-in
randommodule (no extra packages)
-
Clone the repository or download the Python file:
git clone https://github.com/7riangle/English-Phonotactics-Project.git cd English-Phonotactics-Project -
Run the script (file name may be different depending on what you saved):
python ssp_phonotactics.py
-
You should see random syllables printed in the terminal, for example:
plɔːn trɪə frɑːm kwəʊ(Actual outputs will change every time.)
If you want to import the generator in your own code:
from ssp_phonotactics import phonotactics_sequence_with_constraints
print(phonotactics_sequence_with_constraints())You can also call it with:
onset, nucleus, coda = phonotactics_sequence_with_constraints(return_parts=True)
print(onset, nucleus, coda)- Segment list and rules are simplified and hand-made.
- The goal is just to connect phonology ideas (like SSP) with simple Python code.