mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-19 23:27:46 +03:00
29 lines
749 B
Perl
Executable File
29 lines
749 B
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
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`;
|