textgrid
textgrid copied to clipboard
Added support for writing short files
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.
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.
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.