I acknowledge changes to train-model.perl are done with caution. Here's 
one suggestion I think will benefit anyone using MGIZA++.

In the current RC-3 branch, the code looks like this starting at line 253:

     # supporting binaries from other packages
     my $MKCLS = "$_EXTERNAL_BINDIR/mkcls";
     my $MGIZA_MERGE_ALIGN = "$_EXTERNAL_BINDIR/merge_alignment.py";
     my $GIZA;
     my $SNT2COOC;


A "standard" build of MGIZA includes these steps and creates a directory 
tree with $MGIZAPP_PREFIX/bin, $MGIZAPP_PREFIX/lib and 
$MGIZAPP_PREFIX/scripts.

     cmake . -DCMAKE_INSTALL_PREFIX="$MGIZAPP_PREFIX"
     make
     make install


Today, the user must copy (symlink) the merge_alignment.py to complete 
the setup:

     $MGIZAPP_PREFIX/scripts/merge_alignment.py --> 
$MGIZAPP_PREFIX/bin/merge_alignment.py

Then, the user sets the --external-bin-dir on the train-model.perl 
command line:

     --external-bin-dir $MGIZAPP_PREFIX/bin


I propose this modification to train-model.perl

     # supporting binaries from other packages
     my $MKCLS = "$_EXTERNAL_BINDIR/mkcls";
     my $MGIZA_MERGE_ALIGN = "$_EXTERNAL_BINDIR/merge_alignment.py";
     # added to fall back to MGIZA++ default install directory
     if (! -x $MGIZA_MERGE_ALIGN) {
$MGIZA_MERGE_ALIGN="$_EXTERNAL_BINDIR/../scripts/merge_alignment.py";
     }
     my $GIZA;
     my $SNT2COOC;


By adding this fall back, users who setup with a "standard" MGIZA++ 
`make install` don't have to copy the merge_alignment.py file, without 
losing today's functionality.
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to