##################################################################################### # Left single/double quote 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 .leftQuote ##################################################################################### form Select files comment Inserts a left/right single/double quotes into the interval you click word subFolderToProcess 303010.txt\TextGridDone word fileToProcess 303010-11.TextGrid.done.period.num choice Quote: 1 button DQUOTE button SQUOTE choice OutFile: 1 button doubleQ button singleQ endform Read from file... 'subFolderToProcess$'\'fileToProcess$' Rename... grid Edit editor TextGrid grid pause Click the interval to insert a LEFT 'quote$' quote 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 LEFT quote symbols Set interval text... 1 rightEojeolIntervalNum 'eojeolLabel$' leftEojeolIntervalNum = rightEojeolIntervalNum -1 leftQuote$ = "L" + quote$ Set interval text... 1 leftEojeolIntervalNum 'leftQuote$' select TextGrid grid Edit editor TextGrid grid pause Click the interval to insert a RIGHT 'quote$' quote symbol ( to finish) eojeolLabel$ = Get label of interval 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 RIGHT quote symbol rightQuote$ = "R" + quote$ Set interval text... 1 rightEojeolIntervalNum 'rightQuote$' leftEojeolIntervalNum = rightEojeolIntervalNum -1 Set interval text... 1 leftEojeolIntervalNum 'eojeolLabel$' pause Click the interval to insert a LEFT 'quote$' quote 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 ####