mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
escape angle brackets
The script doesn't escape angle brackets which can result in bad SGML / XML output. This fixes that, although ideally, this should be implemented with a proper parser and dumper.
This commit is contained in:
parent
187a75cb55
commit
63c450b401
@ -30,6 +30,8 @@ while(<SRC>) {
|
|||||||
elsif (/<seg/) {
|
elsif (/<seg/) {
|
||||||
my $line = shift(@OUT);
|
my $line = shift(@OUT);
|
||||||
$line = "" if $line =~ /NO BEST TRANSLATION/;
|
$line = "" if $line =~ /NO BEST TRANSLATION/;
|
||||||
|
$line =~ s/</</g;
|
||||||
|
$line =~ s/>/>/g;
|
||||||
if (/<\/seg>/) {
|
if (/<\/seg>/) {
|
||||||
s/(<seg[^>]+> *).*(<\/seg>)/$1$line$2/i;
|
s/(<seg[^>]+> *).*(<\/seg>)/$1$line$2/i;
|
||||||
$missing_end_seg = 0;
|
$missing_end_seg = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user