textgrid icon indicating copy to clipboard operation
textgrid copied to clipboard

Added support for writing short files

Open timjzee opened this issue 6 years ago • 2 comments

Added a short argument to write functions of Tier and TextGrid classes. If short=True the tiers/textgrids are written in the abbreviated short format. Default value of short is set to False, so it should be backward compatible.

timjzee avatar Feb 03 '19 20:02 timjzee

Thanks for this.

I like the idea of adding support for this but repeatedly switching on a single constant boolean inside of a loop is IMO poor design. It should just be if short: ... else: at most one time. Would you be willing to refactor for that? (Or just call the method write_short and put it somewhere else.)

I don't use (or understand why anyone else would use) the short format, and we don't yet support its reading either, so this strikes me as a low priority.

kylebgorman avatar Feb 03 '19 21:02 kylebgorman

Good point. Will implement write_short if I have some spare time. AFAIK the short format is mostly used for large corpora as it saves some space. I'm converting output from a forced aligner to short textgrids so I can more easily compare them to the short textgrids from some of those corpora.

As far as I can tell reading short TextGrids works just fine, btw.

timjzee avatar Feb 03 '19 23:02 timjzee