summaryrefslogtreecommitdiff
path: root/wrap-xml.perl
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2017-11-09 16:12:02 +0100
committerPatrick Simianer <p@simianer.de>2017-11-09 16:12:02 +0100
commit8840c569c862e10c79f30015875bae1e03ae38b7 (patch)
tree33b3d08a3b476124e4a94df279e5f97078b0e290 /wrap-xml.perl
parent60b2027c4f1991276dc3cfd4a2359070f7fa9c62 (diff)
rm
Diffstat (limited to 'wrap-xml.perl')
-rwxr-xr-xwrap-xml.perl41
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";
-}
-