timmahrt / praatIO

A python library for working with praat, textgrids, time aligned audio transcripts, and audio files. It is primarily used for extracting features from and making manipulations on audio files given hierarchical time-aligned transcriptions (utterance > word > syllable > phone, etc).
MIT License
299 stars 32 forks source link

feat: add mergeLabels() method to IntervalTier #47

Closed timmahrt closed 1 year ago

timmahrt commented 1 year ago

This PR adds the mergeLabels() method to IntervalTier.

mergeLabels() can be used for example, to pull in the labels in a phone tier, into a word tier. So interval lists like: [(0, 1, "hi")] and [(0, 0.5, "h"), (0.5, 1, "ai")] would become [(0, 1, "hi(h,ai)")]

codecov[bot] commented 1 year ago

Codecov Report

Base: 75.71% // Head: 75.81% // Increases project coverage by +0.10% :tada:

Coverage data is based on head (dfd938c) compared to base (f57cba3). Patch coverage: 93.75% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## praatio_v6 #47 +/- ## ============================================== + Coverage 75.71% 75.81% +0.10% ============================================== Files 21 21 Lines 2623 2638 +15 ============================================== + Hits 1986 2000 +14 - Misses 637 638 +1 ``` | [Impacted Files](https://codecov.io/gh/timmahrt/praatIO/pull/47?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim) | Coverage Δ | | |---|---|---| | [praatio/data\_classes/interval\_tier.py](https://codecov.io/gh/timmahrt/praatIO/pull/47?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim#diff-cHJhYXRpby9kYXRhX2NsYXNzZXMvaW50ZXJ2YWxfdGllci5weQ==) | `99.17% <93.75%> (-0.39%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.