test_Confusion.praat 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # test_Confusion.praat
  2. # djmw 20110511, 20151020
  3. printline test_Confusion.praat
  4. l$[1] = "u"
  5. l$[2] = "i"
  6. l$[3] = "e"
  7. nlabels = 3
  8. c1 = Create simple Confusion... test 'l$[1]' 'l$[2]' 'l$[3]'
  9. nrows = Get number of rows
  10. ncols = Get number of columns
  11. assert nrows = ncols
  12. assert nrows = nlabels
  13. for i to nlabels
  14. rl$ = Get row label... i
  15. cl$ = Get column label... i
  16. assert rl$ = cl$ and l$[i] = rl$
  17. endfor
  18. for i to 10
  19. stim$ = l$[1]
  20. resp$ = l$[2]
  21. Increase... 'stim$' 'resp$'
  22. val = Get value (labels)... 'stim$' 'resp$'
  23. assert val = i
  24. ssum = Get stimulus sum... 'stim$'
  25. rsum = Get response sum... 'resp$'
  26. assert ssum = rsum and ssum = i
  27. endfor
  28. Remove
  29. printline ...2
  30. c2 = Create simple Confusion... test 'l$[1]' 'l$[2]' 'l$[3]'
  31. Set value... 1 1 6
  32. Set value... 1 2 2
  33. Set value... 1 3 1
  34. Set value... 2 1 3
  35. Set value... 2 2 4
  36. Set value... 2 3 2
  37. Set value... 3 1 1
  38. Set value... 3 2 4
  39. Set value... 3 3 4
  40. select c2
  41. c3 = Group stimuli... "u i" high 1
  42. v = Get value (labels)... high u
  43. assert v = 9
  44. v = Get value (labels)... high i
  45. assert v = 6
  46. v = Get value (labels)... high e
  47. assert v = 3
  48. Remove
  49. printline ...3
  50. select c2
  51. c4 = Group responses... "i e" front 1
  52. v = Get value (labels)... u front
  53. assert v = 3
  54. v = Get value (labels)... i front
  55. assert v = 6
  56. v = Get value (labels)... e front
  57. assert v = 8
  58. plus c2
  59. Remove
  60. printline test_Confusion.praat OK