mosesdecoder/scripts/Transliteration/threshold.pl
2013-12-02 14:49:21 +00:00

31 lines
564 B
Perl
Executable File

#!/usr/bin/perl
use utf8;
require Encode;
use IO::Handle;
$input = <STDIN>;
#print $input;
$filename = shift or die "Error: missing hindi urdu file argument!\n";
open(FILE,$filename) or die "Error: unable to open file \"$filename\"!\n";
binmode(STDIN, ':utf8');
binmode(STDOUT, ':utf8');
binmode(STDERR, ':utf8');
binmode(FILE, ':utf8');
$c=0;
while (<FILE>)
{
chomp;
@F=split("\t");
$hash{$F[0]."\t".$F[1]}=$F[$#F];
$c++;
if($F[$#F] < $input)
{
print "$F[0]\t$F[1]\n";
}
}close FILE;