allows reducing factors from stdin

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1025 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
bojar 2006-11-30 03:46:21 +00:00
parent abd4adfb0c
commit 412f04737c

View File

@ -27,8 +27,14 @@ my @addfactors = grep { ! /^[0-9]+$/ } @requested_factors;
# these are the labelled factors we need to load;
open CORP, $corppathname or die "Can't read $corppathname";
binmode(CORP, ":utf8");
if ($corppathname eq "-") {
*CORP=*STDIN;
die "Won't add factors to corpus coming from stdin." if scalar @addfactors;
} else {
open CORP, $corppathname or die "Can't read $corppathname";
binmode(CORP, ":utf8");
}
my $corpdn = dirname($corppathname);
my $corpbn = basename($corppathname);