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

Cannot concatenate TextGrids despite identical number and name of tiers #29

Open
jhdeov opened this issue May 4, 2024 · 1 comment
Open

Comments

@jhdeov
Copy link

jhdeov commented May 4, 2024

I have two small TextGrids tg1 and tg2. They have the same number of tiers and tier names, but the concatenate code fails and raises an error.

tg1 = tgt.read_textgrid(file1)
tg2 = tgt.read_textgrid(file2)
print(len(tg1.tiers) == len(tg2.tiers))
print(tg1.get_tier_names() == tg2.get_tier_names())
tg = tgt.util.concatenate_textgrids([tg1,tg2])

Result:

/usr/local/lib/python3.10/dist-packages/tgt/util.py in concatenate_textgrids(textgrids, ignore_nonmatching_tiers, use_absolute_time)
151 if (not ignore_nonmatching_tiers and
152 not all([len(common_tiers) == len(tg) for tg in textgrids])):
--> 153 raise TextGridToolsException(
154 'Different numbers of tiers or non-matching tier names.')
155 ccd_tiers = {}
TextGridToolsException: Different numbers of tiers or non-matching tier names.

I get the same error even when I concatenate a file with itself:

9 tg = tgt.util.concatenate_textgrids([tg1,tg1])

@mwlodarczak
Copy link
Collaborator

mwlodarczak commented May 13, 2024 via email

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

2 participants