hbuschme / TextGridTools

Read, write, and manipulate Praat TextGrid files with Python
GNU General Public License v3.0
125 stars 30 forks source link

Extracting and creating new textgrid from existing textgrid file #24

Open mamadyonline opened 2 years ago

mamadyonline commented 2 years ago

Hello,

An interesting feature of the library is the possibility to extract parts from an existing textgrid file. But the feature does not seem to work. I systematically get an AttributeError: 'IntervalTier' object has no attribute 'extract_part'.

Is this normal? How can I make it work?

By recreating the feature using your written function, I have the correct behavior, but with a textgrid that is not nice as the original textgrid. I would like to preserve all other properties of the original textgrid file, but only extracting intervals I need.

Thanks

hbuschme commented 2 years ago

Hello,

the method extract_parts is in the GitHub code, but has not been released yet. I can create a new release (that is then also distributed via pypi) in the next few days. Until then, you can clone the GitHub repo and then use setup.py to install it from source.

Thanks for the ‘bug’ report!

Hendrik

mamadyonline commented 2 years ago

Oh ok... I should have known better.

I would be glad if you can create a new release. But if you think you better wait, no worries, I would just have the function locally for my needs right now.

Thanks for the help