Syllabify force-aligned textgrids
Project description
fave-syllabify
Syllabify a force-aligned TextGrid
Installation
pip install fave-syllabify
Usage
Import classes and functions
from aligned_textgrid import AlignedTextGrid, custom_classes
from fave_syllabify import syllabify_tg
from pathlib import Path
Read in a textgrid
tg = AlignedTextGrid(
textgrid_path=Path(
"docs",
"data",
"josef-fruehwald_speaker.TextGrid"
),
entry_classes=custom_classes(
["Word", "Phone"]
)
)
print(tg)
AlignedTextGrid with 1 groups named ['group_0'] each with [2] tiers. [['Word', 'Phone']]
Syllabify the textgrid
syllabify_tg(tg)
print(tg)
AlignedTextGrid with 1 groups named ['group_0'] each with [4] tiers. [['Word', 'Syllable', 'SylPart', 'Phone']]
Exploring the syllabification
word_tier = tg.group_0.Word
raindrops = word_tier[5]
print(raindrops.label)
raindrops
Each syllable is labelled with its stress.
print([
syl.label
for syl in raindrops.contains
])
['syl-1', 'syl-2']
Each syllable contains its constituent parts in a flat hierarchy (there’s no rhyme constituent).
syl = raindrops.first.fol
print([
part.label
for part in syl.contains
])
['onset', 'nucleus', 'coda']
Each constituent contains its relevant phone.
onset = syl.onset
print([
phone.label
for phone in onset
])
['D', 'R']
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
fave_syllabify-0.1.2.tar.gz
(16.1 kB
view hashes)
Built Distribution
Close
Hashes for fave_syllabify-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba4b62aeed057e27296d0d1b741659e48e7c8cff70021e7522f30f7c5d6989f6 |
|
MD5 | 2aa83fc246077fda67e89b92873bc320 |
|
BLAKE2b-256 | 4472d5aaaf95b18da13fcd7489b8f8de171304f6d7871d49bd4da27af21fbddb |