#!/usr/bin/perl use locale; # praat2ag.pl # (c) Lauri Carlson 2000 # GRID PROLOG print ' ) { print; last if (/item \[\]/); } print "\ ]]>\ \ \ \ \ \ "; $_ = <>; LOOP: { # TIERS if (/item \[([0-9]+)\]/){ $item = $1; print "\ \ \ ) { # TIER PROLOG print; if (/intervals:/) { print ' ]]> '; last; } } while(<>) { # ITEMS SWITCH: for ($_) { /xmin = ([0-9.]+)/ && do { $start = $1; last; }; /xmax = ([0-9.]+)/ && do { $end = $1; last; }; /text = (.*)/ && do { $text = $1; print "\ $text\ "; last; }; } if (/item/) { print ''; goto LOOP; } } } print ' ';