dopefishh / pympi

A python module for processing ELAN and Praat annotation files
MIT License
93 stars 39 forks source link

Allow ELAN timestamp ids to include letters when saving #58

Closed taiqihe closed 3 weeks ago

taiqihe commented 4 months ago

I encountered an error where an ELAN document cannot be saved because some of the time stamp ids have the format of ts{number}_{letters} instead of ts{number}. I don't know ELAN enough to know why this happens but the ELAN validator does not complain about this and the files can be loaded and saved normally in ELAN.

The fix is to use a regular expression to grab the number for primary sorting key and use the string itself for secondary sorting key.

An example eaf file is attached here: https://gist.github.com/taiqihe/8cc3799115d96a133cfc7c17bab7e50c

dopefishh commented 3 weeks ago

Sorry for the delay, feel free to ping next time. Thanks!