File size: 898 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env perl
#
# This file is part of moses.  Its use is licensed under the GNU Lesser General
# Public License version 2.1 or, at your option, any later version.

use warnings;
use strict;
use Getopt::Long "GetOptions";

Getopt::Long::config("no_auto_abbrev");
Getopt::Long::config("pass_through");

my ($TEXT,$ORDER,$BIN,$LM,$MEMORY,$TMPDIR);

&GetOptions('text=s' => \$TEXT,
	    'lm=s' => \$LM,
	    'S=s' => \$MEMORY,
	    'T=s' => \$TMPDIR,
            'bin=s' => \$BIN,
	    'order=i' => \$ORDER);

die("ERROR: specify at least --bin BIN --text CORPUS --lm LM and --order N!")
  unless defined($BIN) && defined($TEXT) && defined($LM) && defined($ORDER);

my $settings = join(' ', @ARGV);

my $cmd = "$BIN --text $TEXT --order $ORDER --arpa $LM $settings";
$cmd .= " -T $TMPDIR" if defined($TMPDIR);
$cmd .= " -S $MEMORY" if defined($MEMORY);
print STDERR "Executing: $cmd\n";
`$cmd`;