mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 15:04:05 +03:00
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:
parent
abd4adfb0c
commit
412f04737c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user