mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 22:14:57 +03:00
Change Bin to RealBin. Thanks to Tom Hoar
This commit is contained in:
parent
7cd8356752
commit
debe090426
@ -8,10 +8,10 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Getopt::Long;
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
my $SCRIPTS_ROOTDIR = $Bin;
|
||||
my $SCRIPTS_ROOTDIR = $RealBin;
|
||||
$SCRIPTS_ROOTDIR =~ s/\/training$//;
|
||||
$SCRIPTS_ROOTDIR = $ENV{"SCRIPTS_ROOTDIR"} if defined($ENV{"SCRIPTS_ROOTDIR"});
|
||||
|
||||
|
@ -4,14 +4,14 @@
|
||||
|
||||
use strict;
|
||||
use Getopt::Long "GetOptions";
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
|
||||
my $host = `hostname`; chop($host);
|
||||
print STDERR "STARTING UP AS PROCESS $$ ON $host AT ".`date`;
|
||||
|
||||
my ($CONFIG_FILE,$EXECUTE,$NO_GRAPH,$CONTINUE,$VERBOSE,$IGNORE_TIME);
|
||||
my $SLEEP = 2;
|
||||
my $META = "$Bin/experiment.meta";
|
||||
my $META = "$RealBin/experiment.meta";
|
||||
|
||||
# check if it is run on a multi-core machine
|
||||
# set number of maximal concurrently active processes
|
||||
@ -156,7 +156,7 @@ sub detect_machine {
|
||||
|
||||
sub detect_if_cluster {
|
||||
my $hostname = `hostname`; chop($hostname);
|
||||
foreach my $line (`cat $Bin/experiment.machines`) {
|
||||
foreach my $line (`cat $RealBin/experiment.machines`) {
|
||||
next unless $line =~ /^cluster: (.+)$/;
|
||||
if (&detect_machine($hostname,$1)) {
|
||||
$CLUSTER = 1;
|
||||
@ -167,7 +167,7 @@ sub detect_if_cluster {
|
||||
|
||||
sub detect_if_multicore {
|
||||
my $hostname = `hostname`; chop($hostname);
|
||||
foreach my $line (`cat $Bin/experiment.machines`) {
|
||||
foreach my $line (`cat $RealBin/experiment.machines`) {
|
||||
next unless $line =~ /^multicore-(\d+): (.+)$/;
|
||||
my ($cores,$list) = ($1,$2);
|
||||
if (&detect_machine($hostname,$list)) {
|
||||
|
@ -6,10 +6,10 @@ binmode(STDIN, ":utf8");
|
||||
binmode(STDOUT, ":utf8");
|
||||
binmode(STDERR, ":utf8");
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use strict;
|
||||
|
||||
my $mydir = "$Bin/nonbreaking_prefixes";
|
||||
my $mydir = "$RealBin/nonbreaking_prefixes";
|
||||
|
||||
my %NONBREAKING_PREFIX = ();
|
||||
my $language = "en";
|
||||
|
@ -12,7 +12,7 @@
|
||||
# And make sure the $settings variable is empty. This script doesn't understand some of the sri args like -unk and will complain.
|
||||
|
||||
use strict;
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use Getopt::Long;
|
||||
|
||||
my $order = 3;
|
||||
|
@ -7,11 +7,11 @@
|
||||
binmode(STDIN, ":utf8");
|
||||
binmode(STDOUT, ":utf8");
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use strict;
|
||||
#use Time::HiRes;
|
||||
|
||||
my $mydir = "$Bin/nonbreaking_prefixes";
|
||||
my $mydir = "$RealBin/nonbreaking_prefixes";
|
||||
|
||||
my %NONBREAKING_PREFIX = ();
|
||||
my $language = "en";
|
||||
|
@ -10,14 +10,14 @@
|
||||
|
||||
use strict;
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use Getopt::Long;
|
||||
|
||||
my $SCRIPTS_ROOTDIR;
|
||||
if (defined($ENV{"SCRIPTS_ROOTDIR"})) {
|
||||
$SCRIPTS_ROOTDIR = $ENV{"SCRIPTS_ROOTDIR"};
|
||||
} else {
|
||||
$SCRIPTS_ROOTDIR = $Bin;
|
||||
$SCRIPTS_ROOTDIR = $RealBin;
|
||||
if ($SCRIPTS_ROOTDIR eq '') {
|
||||
$SCRIPTS_ROOTDIR = dirname(__FILE__);
|
||||
}
|
||||
|
@ -47,10 +47,10 @@
|
||||
# 13 Oct 2004 Use alternative decoders (DWC)
|
||||
# Original version by Philipp Koehn
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
my $SCRIPTS_ROOTDIR = $Bin;
|
||||
my $SCRIPTS_ROOTDIR = $RealBin;
|
||||
$SCRIPTS_ROOTDIR =~ s/\/training$//;
|
||||
$SCRIPTS_ROOTDIR = $ENV{"SCRIPTS_ROOTDIR"} if defined($ENV{"SCRIPTS_ROOTDIR"});
|
||||
|
||||
|
@ -48,13 +48,13 @@
|
||||
# Original version by Philipp Koehn
|
||||
|
||||
use strict;
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
use File::Spec;
|
||||
use Cwd;
|
||||
|
||||
my $SCRIPTS_ROOTDIR = $Bin;
|
||||
my $SCRIPTS_ROOTDIR = $RealBin;
|
||||
$SCRIPTS_ROOTDIR =~ s/\/training$//;
|
||||
$SCRIPTS_ROOTDIR = $ENV{"SCRIPTS_ROOTDIR"} if defined($ENV{"SCRIPTS_ROOTDIR"});
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use strict;
|
||||
use Getopt::Long "GetOptions";
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Spec::Functions;
|
||||
use File::Spec::Unix;
|
||||
use File::Basename;
|
||||
@ -13,7 +13,7 @@ use File::Basename;
|
||||
# Train a model from a parallel corpus
|
||||
# -----------------------------------------------------
|
||||
$ENV{"LC_ALL"} = "C";
|
||||
my $SCRIPTS_ROOTDIR = $Bin;
|
||||
my $SCRIPTS_ROOTDIR = $RealBin;
|
||||
if ($SCRIPTS_ROOTDIR eq '') {
|
||||
$SCRIPTS_ROOTDIR = dirname(__FILE__);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use strict;
|
||||
use Getopt::Long "GetOptions";
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
|
||||
my ($JAR,$GRAMMAR,$SPLIT_HYPHEN,$MARK_SPLIT,$BINARIZE);
|
||||
|
||||
@ -19,12 +19,12 @@ die("ERROR: could not find jar file '$JAR'\n") unless -e $JAR;
|
||||
die("ERROR: could not find grammar file '$GRAMMAR'\n") unless -e $GRAMMAR;
|
||||
|
||||
$BINARIZE = $BINARIZE ? "-binarize" : "";
|
||||
$SPLIT_HYPHEN = $SPLIT_HYPHEN ? "| $Bin/syntax-hyphen-splitting.perl $BINARIZE" : "";
|
||||
$SPLIT_HYPHEN = $SPLIT_HYPHEN ? "| $RealBin/syntax-hyphen-splitting.perl $BINARIZE" : "";
|
||||
$SPLIT_HYPHEN .= " -mark-split" if $SPLIT_HYPHEN && $MARK_SPLIT;
|
||||
|
||||
my $tmp = "/tmp/parse-de-berkeley.$$";
|
||||
|
||||
open(TMP,"| $Bin/../../tokenizer/deescape-special-chars.perl > $tmp");
|
||||
open(TMP,"| $RealBin/../../tokenizer/deescape-special-chars.perl > $tmp");
|
||||
while(<STDIN>) {
|
||||
# unsplit hyphens
|
||||
s/ \@-\@ /-/g if $SPLIT_HYPHEN;
|
||||
@ -37,7 +37,7 @@ while(<STDIN>) {
|
||||
}
|
||||
close(TMP);
|
||||
|
||||
my $cmd = "cat $tmp | java -Xmx10000m -Xms10000m -Dfile.encoding=UTF8 -jar $JAR -gr $GRAMMAR -maxLength 1000 $BINARIZE | $Bin/berkeleyparsed2mosesxml.perl $SPLIT_HYPHEN";
|
||||
my $cmd = "cat $tmp | java -Xmx10000m -Xms10000m -Dfile.encoding=UTF8 -jar $JAR -gr $GRAMMAR -maxLength 1000 $BINARIZE | $RealBin/berkeleyparsed2mosesxml.perl $SPLIT_HYPHEN";
|
||||
print STDERR $cmd."\n";
|
||||
|
||||
open(PARSE,"$cmd|");
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use strict;
|
||||
use Getopt::Long "GetOptions";
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Basename;
|
||||
use File::Temp qw/tempfile/;
|
||||
|
||||
|
@ -12,9 +12,9 @@
|
||||
|
||||
# 29 Dec 2009 Derived from mert-moses-new.pl (Kamil Kos)
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Basename;
|
||||
my $SCRIPTS_ROOTDIR = $Bin;
|
||||
my $SCRIPTS_ROOTDIR = $RealBin;
|
||||
$SCRIPTS_ROOTDIR =~ s/\/training$//;
|
||||
$SCRIPTS_ROOTDIR = $ENV{"SCRIPTS_ROOTDIR"} if defined($ENV{"SCRIPTS_ROOTDIR"});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user