dopefishh / pympi

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

add_annotation does not check if the time stamp (left/right) does already exist #20

Open thomaskisler opened 5 years ago

thomaskisler commented 5 years ago

I would expect if I add an annotation that first, the add_annotation(...) method would check if the timestamp does already exist in a linked tier. And if so, it would use the already existing time stamp, before adding a new one. However, that is not what I see. Is this on purpose?

I am using pympi 1.69

dopefishh commented 5 years ago

This is not on purpose and would be a perfect enhancement of the library

dopefishh commented 5 years ago

This could be implemented by patching the generate_ts_id function.

dopefishh commented 3 years ago

I've reverted the MR because not all functions take this property into mind and therefore some functionality behaves off due to reusing timeslots.

Cogitarian commented 3 years ago

Adding new annotations works only for nonadjacent annotations, that is when the onset of the annotation I add does not equal to the ending of a previous one. Suppose I have two annotations with timestamps: 1000-2000 and 2000-3000. I can't add new annotation starting at 3000 and I can't change the first annotation with re moving it and adding a new one with a new label. Is there any other way to remove or change annotation which have the same ending as the next one? I hope it is clear ;)