Skip to main content

Syllabify force-aligned textgrids

Project description

fave-syllabify

PyPI version Lint and Test Build Docs codecov DOI

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


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.3.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

fave_syllabify-0.1.3-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file fave_syllabify-0.1.3.tar.gz.

File metadata

  • Download URL: fave_syllabify-0.1.3.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.7 Darwin/23.2.0

File hashes

Hashes for fave_syllabify-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a565db9c6faeee9b7943c4c2cca6b014b64a9b0df0ddfa1bb7a8cd3ef0952177
MD5 91cc3bc4ceb91c089932d1d50f44ec52
BLAKE2b-256 e01306e19f74ed0f73f3ce52d6ff421cef31f0bce792e2042ac92076bc1b2c65

See more details on using hashes here.

File details

Details for the file fave_syllabify-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fave_syllabify-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.7 Darwin/23.2.0

File hashes

Hashes for fave_syllabify-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 331d97b6c8e3f3baac318aa4d22797593f65717e4474a426c174c2c66e6b112f
MD5 6bde6e78388f8b057afb43f886ad8a28
BLAKE2b-256 cac292c895654306fc6515f5e4748cc441c493bff99a2c847d90ff47faa30bce

See more details on using hashes here.

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