Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. selectObject: "TextGrid Sound_IEatStinkyFish"
  2. Get number of tiers
  3. Down to Table... false 6 true false
  4. selectObject: "Table Sound_IEatStinkyFish"
  5. num_rows = Get number of rows
  6.  
  7.  
  8. word$ = ""
  9. # word$ will change when we see a new word in the TIER column
  10. # We want to tell Praat to "remember the last word we have seen"
  11.  
  12. skeleton$ = ""
  13.  
  14. for i from 1 to num_rows
  15. tmin = Get value... i tmin
  16. tmax = Get value... i tmax
  17. tier$ = Get value... i tier
  18. text$ = Get value... i text
  19.  
  20. duration = tmax - tmin
  21.  
  22. if tier$ = "words"
  23. # we update the word$ when we encounter "words" in TIER column
  24. word$ = text$
  25.  
  26. elsif tier$ = "skeleton"
  27. # we update the skeleton$ when we encounter "skeleton" in TIER column
  28. skeleton$ = text$
  29.  
  30. elsif tier$ = "segments"
  31. appendInfoLine: word$, " ", skeleton$, " ", text$, " ", duration
  32.  
  33. endif
  34.  
  35.  
  36. endfor
  37.  
  38. appendFile: "test.txt", info$ ( )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement