|
@@ -10,14 +10,16 @@ files = Path(input_dir).glob('*.TextGrid')
|
|
|
|
|
|
#Loop through each textgrid file of the folder
|
|
|
for file in files:
|
|
|
+
|
|
|
#open textgrid file
|
|
|
print(file)
|
|
|
grid = pr.TextGrid(file)
|
|
|
+
|
|
|
#initialize header
|
|
|
df = pd.DataFrame(columns= ["speaker_id","segment_offset","mwu_type","transcription","speaker_type",
|
|
|
"segment_onset","vcm_type","addresseee","raw_filename","ling_type","lex_type"])
|
|
|
|
|
|
- #loop through all tiers, might want to loop through each textgrid
|
|
|
+ #loop through all tiers
|
|
|
for tier in grid.get_tiers():
|
|
|
for interval in tier.get_all_intervals():
|
|
|
df = df.append(pd.Series({'speaker_id': tier.name, 'segment_onset': interval[0]*1000,
|