Skip to content

Instantly share code, notes, and snippets.

@psibre
Created March 15, 2014 18:15
Show Gist options
  • Save psibre/abf0d2ac833046af17cb to your computer and use it in GitHub Desktop.
Save psibre/abf0d2ac833046af17cb to your computer and use it in GitHub Desktop.
#! /usr/bin/env perl
$indir = "lab_raw";
opendir INDIR, $indir;
@files = grep (/\.lab$/,readdir INDIR);
closedir INDIR;
foreach $file (@files)
{
open INFILE, "$indir/$file";
@lines = <INFILE>;
close INFILE;
open OUTFILE, ">lab/$file";
for(@lines){
s/zh/Z/;
s/hh/h/;
s/th/T/;
s/ih/I/;
s/pau/_/;
s/uw/u/;
s/dh/D/;
s/ay/AI/;
s/ey/EI/;
s/uh/U/;
s/ax/\@/;
s/sh/S/;
s/aw/aU/;
s/ow/\@U/;
s/oy/OI/;
s/eh/E/;
s/ao/O/;
s/jh/dZ/;
s/iy/i/;
s/ng/N/;
s/aa/A/;
s/ch/tS/;
s/ah/V/;
s/er/r=/;
s/ae/{/;
s/y/j/;
}
print OUTFILE @lines;
close OUTFILE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment