mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-26 19:37:58 +03:00
29 lines
760 B
Perl
Executable File
29 lines
760 B
Perl
Executable File
#!/usr/bin/env perl
|
|
#
|
|
# This file is part of moses. Its use is licensed under the GNU Lesser General
|
|
# Public License version 2.1 or, at your option, any later version.
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
while (@ARGV) {
|
|
$_ = shift;
|
|
/^-b$/ && ($| = 1, next); # not buffered (flush each line)
|
|
}
|
|
|
|
while(<STDIN>) {
|
|
s/\&bar;/\|/g; # factor separator (legacy)
|
|
s/\|/\|/g; # factor separator
|
|
s/\</\</g; # xml
|
|
s/\>/\>/g; # xml
|
|
s/\&bra;/\[/g; # syntax non-terminal (legacy)
|
|
s/\&ket;/\]/g; # syntax non-terminal (legacy)
|
|
s/\"/\"/g; # xml
|
|
s/\'/\'/g; # xml
|
|
s/\[/\[/g; # syntax non-terminal
|
|
s/\]/\]/g; # syntax non-terminal
|
|
s/\&/\&/g; # escape escape
|
|
s/\"([^\"]*)\"/\`\`$1\'\'/g;
|
|
print $_;
|
|
}
|