#!/usr/bin/env perl use warnings; #sed replacement for -w perl parameter # Copyright Chao Weng # normalizations for hkust trascript # see the docs/trans-guidelines.pdf for details while () { @A = split(" ", $_); print "$A[0] "; for ($n = 1; $n < @A; $n++) { $tmp = $A[$n]; if ($tmp =~ //) {$tmp =~ s:::g;} if ($tmp =~ /<%>/) {$tmp =~ s:<%>::g;} if ($tmp =~ /<->/) {$tmp =~ s:<->::g;} if ($tmp =~ /<\$>/) {$tmp =~ s:<\$>::g;} if ($tmp =~ /<#>/) {$tmp =~ s:<#>::g;} if ($tmp =~ /<_>/) {$tmp =~ s:<_>::g;} if ($tmp =~ //) {$tmp =~ s:::g;} if ($tmp =~ /`/) {$tmp =~ s:`::g;} if ($tmp =~ /&/) {$tmp =~ s:&::g;} if ($tmp =~ /,/) {$tmp =~ s:,::g;} if ($tmp =~ /[a-zA-Z]/) {$tmp=uc($tmp);} if ($tmp =~ /A/) {$tmp =~ s:A:A:g;} if ($tmp =~ /a/) {$tmp =~ s:a:A:g;} if ($tmp =~ /b/) {$tmp =~ s:b:B:g;} if ($tmp =~ /c/) {$tmp =~ s:c:C:g;} if ($tmp =~ /k/) {$tmp =~ s:k:K:g;} if ($tmp =~ /t/) {$tmp =~ s:t:T:g;} if ($tmp =~ /,/) {$tmp =~ s:,::g;} if ($tmp =~ /丶/) {$tmp =~ s:丶::g;} if ($tmp =~ /。/) {$tmp =~ s:。::g;} if ($tmp =~ /、/) {$tmp =~ s:、::g;} if ($tmp =~ /?/) {$tmp =~ s:?::g;} print "$tmp "; } print "\n"; }