#!/usr/bin/perl

use open qw(:std :utf8);

if ($ARGV[0] eq '-c') {
    $CONTROL = 1;
    shift;
}

while (<>) {
    my ($uttid, $txt) = /\(\s*(\S+)\s+\"([^"]+)\"/;
    $txt = uc $txt;
    $txt =~ s/\pP//g;
    if ($CONTROL) {
	print "$uttid\n";
    }
    else {
	print "<s> $txt </s> ($uttid)\n";
    }
}
