Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tier entries that have blank labels are not read #29

Closed
stevebeet opened this issue May 17, 2021 · 6 comments
Closed

Tier entries that have blank labels are not read #29

stevebeet opened this issue May 17, 2021 · 6 comments

Comments

@stevebeet
Copy link

I have many textgrid files with some or all the labels in specific tiers being deliberately set to be blank. Praatio just skips over them, ignoring the time information (which is what I need to retrieve). I have tried both a prebuilt version from "pip install" and the latest version from github, installed using setup.py

The attached file has three entries in its only tier, and two of them are empty. Only one is retrieved by praatio.

EmptyLabelBug.Txt

@timmahrt
Copy link
Owner

timmahrt commented May 17, 2021

Hi,
The functionality you described is there by (poor) design. What you want is to use is this:

openTextgrid(fn, readRaw=True)

http://timmahrt.github.io/praatIO/praatio/tgio.html#openTextgrid

You're not the first one to be confused by the default behavior and I'm working on a new version of PraatIO that will hopefully amend the situation (#28).

Sorry for the headaches!
Tim

@timmahrt
Copy link
Owner

timmahrt commented May 21, 2021

Hi,
I'm just checking in. Did my suggestion fix the problem for you?

I've been busy recently, so the fix for PraatIO might still be a few weeks away.
Tim

@SolomidHero
Copy link

Hi! I faced the same problem and readRaw=True fixed it, so empty labels "" are visible

@timmahrt
Copy link
Owner

timmahrt commented Jul 31, 2021

I'm glad readRaw=True fixed your problem. More user friendly behavior is still planned for Praatio 5.0. I'm gearing up to release it soon but haven't had time to make the final changes needed for it recently.

I still hope to have it out soon though.

@timmahrt
Copy link
Owner

timmahrt commented Aug 9, 2021

Praatio 5.0 has now been released and includes a quality-of-life improvement for this issue.

openTextgrid has a new required argument includeEmptyIntervals, so the previous, default behavior should no longer be encountered:

textgrid.openTextgrid(
  fn=name,
  includeEmptyIntervals=False
)

I'm sorry this took so long to release.

If you are using Praatio 4.x and want to upgrade, changes are needed in your code. Please check the readme:
https://github.com/timmahrt/praatIO#version-4-to-5-migration

And let me know if you have any questions. Thank you!

@timmahrt
Copy link
Owner

I'm going to close this issue now, since the issue has been fixed as far as I'm aware. Please feel free to reopen it if you have related questions or problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants