On 11/30/2011 04:10, Hieu Hoang wrote:
hi giuseppe
using relative directory hasn't been supported because the perl
scripts often have 'cd' commands inside them which mess things up.
However, it'll be nice to be able to use relative paths.
I suppose if you have a fix to allow relative paths, do a pull request
to the git repository and we can go from there.
Thanks for the suggestion.
My proposal is to change create_extractor_script so that it gets the
name of the script from the caller:
sub create_extractor_script()
{
my ($cmd, $script_path) = @_;
open(OUT,"> $script_path")
or die "Can't write $script_path";
...
The calller can then decide where the script will go, consistently to
deciding where the outputs of the script will go, in lines 666-668:
$cmd = create_extractor_script($cmd, "extract.sh");
&submit_or_exec($cmd,"extract.out","extract.err");
-- Beppe
On 29 November 2011 21:06, Giuseppe Attardi <[email protected]
<mailto:[email protected]>> wrote:
The latest version of mert-moses.pl <http://mert-moses.pl> at line
666 invokes:
$cmd = create_extractor_script($cmd, $___WORKING_DIR);
which tries to create a file called extractor.sh in directory
$__WOKRING_DIR.
However, if the value of $__WORKING_DIR is a relative path, and
since the
command is run already in that directory (see line 433:
chdir($___WORKING_DIR) or die "Can't chdir to $___WORKING_DIR";
)
the effect is to try to create a file in a non-exsisting subdirectory.
Hence I suggest to drop the second argument to
create_extractor_script().
-- Beppe Attardi
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support