blob: f2cf14f4095791090db7c24a719c302f4c39d3a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/env perl
use warnings;
use strict;
use File::Temp qw/tempfile/;
use Getopt::Long "GetOptions";
my $TMPDIR = "tmp";
my $SCHEME = "D2";
my $KEEP_TMP = 0;
GetOptions(
"scheme=s" => \$SCHEME,
"tmpdir=s" => \$TMPDIR,
"keep-tmp" => \$KEEP_TMP
) or die("ERROR: unknown options");
`mkdir -p $TMPDIR`;
my ($dummy, $tmpfile) = tempfile("mada-in-XXXX", DIR=>$TMPDIR, UNLINK=>!$KEEP_TMP);
print STDERR $tmpfile."\n";
open(TMP,">$tmpfile");
while(<STDIN>) {
print TMP $_;
}
close(TMP);
my $madadir = "/home/pkoehn/statmt/project/mada-3.2";
`perl $madadir/MADA+TOKAN.pl >/dev/null 2>/dev/null config=$madadir/config-files/template.madaconfig file=$tmpfile TOKAN_SCHEME="SCHEME=$SCHEME"`;
`rm $tmpfile`;
`rm $tmpfile.bw`;
`rm $tmpfile.bw.mada`;
print `cat $tmpfile.bw.mada.tok`;
`rm $tmpfile.bw.mada.tok`;
|