File size: 1,022 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
#!/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";
use FindBin qw($RealBin);

my ($DIR,$F,$E,$ALIGNMENT,$CORPUS,$SETTINGS);
die("ERROR: syntax is --alignment FILE --corpus FILESTEM --f EXT --e EXT --DIR OUTDIR --settings STRING")
    unless &GetOptions('DIR=s' => \$DIR,
		       'f=s' => \$F,
		       'e=s' => \$E,
		       'corpus=s' => \$CORPUS,
		       'alignment=s' => \$ALIGNMENT,
		       'settings=s' => \$SETTINGS)
	   && defined($DIR) && defined($F) && defined($E) && defined($CORPUS) && defined($ALIGNMENT)
           && -e $ALIGNMENT && -e "$CORPUS.$F" && -e "$CORPUS.$E";

`mkdir $DIR`;
`$RealBin/../../bin/mtt-build < $CORPUS.$F -i -o $DIR/$F`;
`$RealBin/../../bin/mtt-build < $CORPUS.$E -i -o $DIR/$E`;
`$RealBin/../../bin/symal2mam < $ALIGNMENT $DIR/$F-$E.mam`;
`$RealBin/../../bin/mmlex-build $DIR/ $F $E -o $DIR/$F-$E.lex`;