| 1 |
# test_Strings_and_Permutation.praat |
| 2 |
# djmw 20220928 |
| 3 |
|
| 4 |
appendInfoLine: "test_Strings_and_Permutation" |
| 5 |
veca# = {1, 10, 11, 22, 3, 5} |
| 6 |
vecn# = {1, 3, 5, 10, 11, 22 } |
| 7 |
|
| 8 |
strings = Create Strings from tokens: "s", "11 10 1 22 3 5", " " |
| 9 |
pa = To Permutation: "Alphabetical" |
| 10 |
plusObject: strings |
| 11 |
stringsa = Permute strings |
| 12 |
for i to size (veca#) |
| 13 |
number$ = Get string: i |
| 14 |
assert number (number$) = veca# [i] |
| 15 |
endfor |
| 16 |
removeObject: stringsa, pa |
| 17 |
|
| 18 |
selectObject: strings |
| 19 |
pn = To Permutation: "number-aware" |
| 20 |
plusObject: strings |
| 21 |
stringsn = Permute strings |
| 22 |
for i to size (veca#) |
| 23 |
number$ = Get string: i |
| 24 |
assert number (number$) = vecn# [i] |
| 25 |
endfor |
| 26 |
removeObject: stringsn, pn, strings |
| 27 |
|
| 28 |
table = Create Table with column names: "table", 100, { "factor", "data" } |
| 29 |
Formula: "data", "randomGauss (0, 1)" |
| 30 |
Formula: "factor", "randomUniform (1,6)" |
| 31 |
Formula: "factor", "veca# [self]" |
| 32 |
|
| 33 |
removeObject: table |
| 34 |
|
| 35 |
appendInfoLine: "test_Strings_and_Permutation OK" |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|