test_TextGrid_extensions.praat 671 B

1234567891011121314151617181920212223242526272829303132
  1. # test_TextGrid_extensions.praat
  2. # djmw 20110523, 20140904
  3. # ppgb 20180705 corrected regexp
  4. appendInfoLine: "test_TextGrid_extensions"
  5. s = Read Strings from raw text file: "TIMIT_train_dr1_fcjf0_sa1.phn"
  6. ns = Get number of strings
  7. tg = Read from file: "TIMIT_train_dr1_fcjf0_sa1.phn"
  8. ntiers = Get number of tiers
  9. assert ntiers = 2
  10. nints = Get number of intervals: 1
  11. assert nints = ns
  12. for i to ns
  13. selectObject: s
  14. string$ = Get string: i
  15. slabel$ = replace_regex$ (string$, "([0-9]|\s)*", "", 0)
  16. selectObject: tg
  17. tglabel$ = Get label of interval: 1, i
  18. assert slabel$ = tglabel$ ; 'i'
  19. endfor
  20. removeObject: s, tg
  21. appendInfoLine: "test_TextGrid_extensions OK"