diff options
author | Patrick Simianer <p@simianer.de> | 2017-11-09 16:12:02 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2017-11-09 16:12:02 +0100 |
commit | 8840c569c862e10c79f30015875bae1e03ae38b7 (patch) | |
tree | 33b3d08a3b476124e4a94df279e5f97078b0e290 /wrap-xml.perl | |
parent | 60b2027c4f1991276dc3cfd4a2359070f7fa9c62 (diff) |
rm
Diffstat (limited to 'wrap-xml.perl')
-rwxr-xr-x | wrap-xml.perl | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/wrap-xml.perl b/wrap-xml.perl deleted file mode 100755 index 06303b7..0000000 --- a/wrap-xml.perl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl -w -# original: https://smt.googlecode.com/svn/trunk/moses64/tools/scripts/wrap-xml.perl -# (licensed under LGPL) - -use strict; - -my $src = $ARGV[0]; -my $language = $ARGV[1]; -die("syntax: wrap-xml.perl xml-frame language [system-name]") - unless $src && $language && -e $src; -my $system = "my-system"; -$system = $ARGV[2] if defined($ARGV[2]); - -open(SRC,$src); -my @OUT = <STDIN>; -chomp(@OUT); -#my @OUT = `cat $decoder_output`; -while(<SRC>) { - chomp; - if (/^<srcset/) { - s/<srcset/<tstset trglang="$language" sysid="$system"/; - } - elsif (/^<\/srcset/) { - s/<\/srcset/<\/tstset/; - } - elsif (/^<DOC/) { - s/<DOC/<DOC sysid="$system"/; - } - elsif (/<seg/) { - my $line = shift(@OUT); - $line = "" if $line =~ /NO BEST TRANSLATION/; - if (/<\/seg>/) { - s/(<seg[^>]+> *).+(<\/seg>)/$1$line$2/; - } - else { - s/(<seg[^>]+> *)[^<]+/$1$line/; - } - } - print $_."\n"; -} - |