##################################################################################### # Comma & hyphen inserter in interval tier : Written by Kyuchul Yoon ( kyoon@ling.osu.edu ) # Splits specified interval tier into a left quote and an intervalText # # Directory structure for this script should be like the following # root\ : Script should be here # 302000.txt\TextGridDone # 302002.txt\TextGridDone # 302004.txt\TextGridDone # .... # The filename of the output files are .comma ##################################################################################### form Select files comment Inserts a left/right single/double quotes into the interval you click word longSoundFile 302004.wav word subFolderToProcess 302004.txt\TextGridDone word fileToProcess 302004-67.TextGrid.done choice OutFile: 1 button complete endform # Open the long sound file Open long sound file... 'longSoundFile$' Rename... lsound Read from file... 'subFolderToProcess$'\'fileToProcess$' Rename... grid select TextGrid grid plus LongSound lsound Edit editor TextGrid grid pause Click the interval to insert a 'symbol$' symbol ( to finish) eojeolLabel$ = Get label of interval ############ For double quotes while (eojeolLabel$ <> "") startPointInterval = Get starting point of interval endPointInterval = Get end point of interval midPointInterval = startPointInterval + (endPointInterval - startPointInterval)/2 endeditor select TextGrid grid tempNum = Get interval at time... 1 startPointInterval rightEojeolIntervalNum = tempNum + 1 Insert boundary... 1 midPointInterval # For inserting the symbol Set interval text... 1 rightEojeolIntervalNum 'symbol$' leftEojeolIntervalNum = rightEojeolIntervalNum -1 Set interval text... 1 leftEojeolIntervalNum 'eojeolLabel$' pause Click the interval to insert a 'symbol$' symbol ( to finish) select TextGrid grid editor TextGrid grid eojeolLabel$ = Get label of interval endwhile endeditor pause File to be updated and written to 'fileToProcess$'.'outFile$' select TextGrid grid Write to text file... 'subFolderToProcess$'\'fileToProcess$'.'outFile$' Remove select LongSound lsound Remove #### END OF SCRIPT ####