| 1 |
# Discriminant2.praat |
| 2 |
# Paul Boersma 2020-05-06 |
| 3 |
|
| 4 |
writeInfoLine: "Discriminant2" |
| 5 |
|
| 6 |
table = Create TableOfReal (Pols 1973): "no" |
| 7 |
Formula: "log10(self)" |
| 8 |
|
| 9 |
procedure tryOldFormat |
| 10 |
oldDiscriminant = Read from file: "pols_50males_format0.Discriminant" |
| 11 |
Save as text file: "kanweg.Discriminant" |
| 12 |
plusObject: table |
| 13 |
classificationTable = To ClassificationTable: "yes", "yes" |
| 14 |
confusion = To Confusion: "no" |
| 15 |
fractionCorrect = Get fraction correct |
| 16 |
appendInfoLine: "Old format correct: ", fractionCorrect |
| 17 |
removeObject: classificationTable, confusion, oldDiscriminant |
| 18 |
endproc |
| 19 |
|
| 20 |
procedure tryNewFormat |
| 21 |
newDiscriminant = Read from file: "kanweg.Discriminant" |
| 22 |
plusObject: table |
| 23 |
classificationTable = To ClassificationTable: "yes", "yes" |
| 24 |
confusion = To Confusion: "no" |
| 25 |
fractionCorrect = Get fraction correct |
| 26 |
appendInfoLine: "New format correct: ", fractionCorrect |
| 27 |
removeObject: classificationTable, confusion, newDiscriminant |
| 28 |
endproc |
| 29 |
|
| 30 |
procedure tryComputation |
| 31 |
selectObject: table |
| 32 |
computedDiscriminant = To Discriminant |
| 33 |
plusObject: table |
| 34 |
classificationTable = To ClassificationTable: "yes", "yes" |
| 35 |
confusion = To Confusion: "no" |
| 36 |
fractionCorrect = Get fraction correct |
| 37 |
appendInfoLine: "Computed correct: ", fractionCorrect |
| 38 |
removeObject: classificationTable, confusion, computedDiscriminant |
| 39 |
endproc |
| 40 |
|
| 41 |
@tryComputation |
| 42 |
@tryOldFormat |
| 43 |
@tryNewFormat |
| 44 |
|
| 45 |
@tryComputation |
| 46 |
@tryOldFormat |
| 47 |
@tryNewFormat |
| 48 |
|
| 49 |
@tryNewFormat |
| 50 |
@tryOldFormat |
| 51 |
@tryComputation |
| 52 |
|
| 53 |
@tryNewFormat |
| 54 |
@tryOldFormat |
| 55 |
@tryComputation |
| 56 |
|
| 57 |
removeObject: table |
| 58 |
|
| 59 |
appendInfoLine: "Discriminant2 OK" |