##################################################################################### # 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 subFolderToProcess 303010.txt\TextGridDone word fileToProcess 303010-05.TextGrid.done.domma choice Symbol: 2 button COMMA button HYPHEN choice OutFile: 2 button comma button hyphen endform Read from file... 'subFolderToProcess$'\'fileToProcess$' Rename... grid 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$' Write to text file... 'subFolderToProcess$'\'fileToProcess$'.'outFile$' Remove #### END OF SCRIPT ####