dopefishh / pympi

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

Can't remove tiers in loop #19

Closed Cogitarian closed 5 years ago

Cogitarian commented 5 years ago

I have tens of eaf files with different tiers to be removed and I've writtten script to remove them using a loop. Surprisingly, it doesn't work properly. I attach two sample eaf files and the script. SAMPLE.zip

dopefishh commented 5 years ago

I'm not sure what you are trying to achieve, the first file has the following tiers: 'lh_Activation_S', 'comments rh S', 'comments lh S'

The second has: 'comments rh S', 'comments lh S', 'comments', 'COACH'

None of those are in the to-remove list.

Furthermore, the script is strange in many ways. The indentation is not according to the python standard. The files you have start with a -, that is very confusing for command line users because they have to jump to hoops to pass them to a command line program. Also, the python code is very strange, many duplicate lines without any meaning (e.g. line 12, 15, 17, 20) and you use reserved. I'll close this for now, if the problem persists, please create a script that is reproducible.

Cogitarian commented 5 years ago

Thanks for the feedback. Have you tried looping files with normal names and remove any tier that is inside them?

It really doesn't work with any filename and since it creates some files output, I assume that the indentations does not matter. However, I work more in elan then in python, so the code might be wrong.

dopefishh commented 5 years ago

Well, I cannot reproduce it, the script appears to works as well. No exceptions or weird behaviour. Please send a script for actually reproducing the bug so that I can fix it.