##################################################################################### # Eojeol time log creator script: Written by Kyuchul Yoon ( kyoon@ling.osu.edu ) # Script should be in the parent directory where 30[23]00[024].txt/ folders belong. # A subdirectory should be TextGridDone/. # The script assumes that you already have the TextGrid files labelled by a professional K-ToBI labeler. # The script will read in all the .done files one by one from TextGridDone/ directory # and write default log files into EojeolTimeLog/ directory. # The filename of the output Eojeol Time Log files are ...log ##################################################################################### # Specify files and folders form Select files word longSoundFolder_(should_be_a_subfolder) 303010.txt word doneFilesSubFolder TextGridDone word fileExtOfDoneFiles_(without_dot) done word eojeolTimeLogSubFolder EojeolTimeLog endform # Get .done files for loop Create Strings as file list... fileList 'longSoundFolder$'\'doneFilesSubFolder$'\*.'fileExtOfDoneFiles$' numFiles = Get number of strings for iFile to numFiles select Strings fileList # Get the name for .done file doneFile$ = Get string... iFile Read from file... 'longSoundFolder$'\'doneFilesSubFolder$'\'doneFile$' # If an old file exists, delete it first and then write out the log info. filedelete 'longSoundFolder$'\'eojeolTimeLogSubFolder$'\'doneFile$'.eojeol # Get the number of intervals from the first tier (word tier) numIntervals = Get number of intervals... 1 # Loop through each interval (eojeol) and output that with its time log to a file in another folder for iEojeol to numIntervals # Get the interval text intervalText$ = Get label of interval... 1 iEojeol # Get starting and end point of the interval startInterval = Get starting point... 1 iEojeol endInterval = Get end point... 1 iEojeol fileappend 'longSoundFolder$'\'eojeolTimeLogSubFolder$'\'doneFile$'.eojeol ... 'intervalText$''tab$''startInterval''tab$''endInterval''newline$' endfor Remove select Strings fileList endfor Remove #### END OF SCRIPT ####