-
Notifications
You must be signed in to change notification settings - Fork 0
/
cp_makeDico.praat
37 lines (33 loc) · 959 Bytes
/
cp_makeDico.praat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
form cp_makeDico v0.01 Ferragne 2016
comment Choose tier containing vowel labels
integer tier 1
endform
myList$ = chooseReadFile$: "Choose list of wav files"
if myList$ <> ""
Read Strings from raw text file: myList$
listName$ = selected$("Strings")
nbFiles = Get number of strings
for i to nbFiles
selectObject: "Strings " + listName$
currentFile$ = Get string: i
Read from file: currentFile$ - ".wav" + ".TextGrid"
Extract one tier: tier
Down to Table: "no", 1, "no", "no"
if i <> 1
plusObject: "Table myDico"
Append
endif
Rename: "myDico"
endfor
Remove column: "tmin"
Remove column: "tmax"
Collapse rows: "text", "", "", "", "", ""
nbRows = Get number of rows
myDicoFile$ = chooseWriteFile$: "Save dictionary file", "myDico.txt"
if myDicoFile$ <> ""
for k to nbRows
currentSymb$ = Get value: k, "text"
appendFileLine: myDicoFile$, currentSymb$
endfor
endif
endif