mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
Merge branch 'hieu' of github.com:hieuhoang/mosesdecoder into hieu
This commit is contained in:
commit
5198352ce2
@ -15,6 +15,7 @@ my $DEESCAPE = "$SCRIPTS_ROOT_DIR/tokenizer/deescape-special-chars.perl";
|
||||
my $DEBUG = 0;
|
||||
my $BASIC = 0;
|
||||
my $OLD_BITPAR = 0;
|
||||
my $UNPARSEABLE = 0;
|
||||
|
||||
my $RAW = "";
|
||||
|
||||
@ -22,7 +23,8 @@ GetOptions(
|
||||
"basic" => \$BASIC,
|
||||
"bitpar=s" => \$BITPAR,
|
||||
"old-bitpar" => \$OLD_BITPAR,
|
||||
"raw=s" => \$RAW
|
||||
"raw=s" => \$RAW,
|
||||
"unparseable" => \$UNPARSEABLE
|
||||
) or die("ERROR: unknown options");
|
||||
|
||||
`mkdir -p $TMPDIR`;
|
||||
@ -71,6 +73,12 @@ if ($OLD_BITPAR)
|
||||
open(PARSER,$pipeline);
|
||||
while(my $line = <PARSER>) {
|
||||
if ($line =~ /^No parse for/) {
|
||||
if ($UNPARSEABLE) {
|
||||
my $len = length($line);
|
||||
$line = substr($line, 15, $len - 17);
|
||||
$line = escape($line);
|
||||
print $line;
|
||||
}
|
||||
print "\n";
|
||||
next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user