Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Post <post@cs.jhu.edu>2019-04-26 21:24:07 +0300
committerGitHub <noreply@github.com>2019-04-26 21:24:07 +0300
commit63c450b40125f98d2d666f5bc3f439cf3fac326a (patch)
treec890e5a06a3d4b5ecfeebe0b8d44e285488564e0 /scripts/ems/support
parent187a75cb5596c8e4362c66c62de395e2b7d3a64a (diff)
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.
Diffstat (limited to 'scripts/ems/support')
-rwxr-xr-xscripts/ems/support/wrap-xml.perl2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/ems/support/wrap-xml.perl b/scripts/ems/support/wrap-xml.perl
index 09ea2a2f8..52fc0c001 100755
--- a/scripts/ems/support/wrap-xml.perl
+++ b/scripts/ems/support/wrap-xml.perl
@@ -30,6 +30,8 @@ while(<SRC>) {
elsif (/<seg/) {
my $line = shift(@OUT);
$line = "" if $line =~ /NO BEST TRANSLATION/;
+ $line =~ s/</&lt;/g;
+ $line =~ s/>/&gt;/g;
if (/<\/seg>/) {
s/(<seg[^>]+> *).*(<\/seg>)/$1$line$2/i;
$missing_end_seg = 0;