Download tools/mosesdecoder/scripts/generic/reverse-alignment.perl from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/scripts/generic/reverse-alignment.perl
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/scripts/generic/reverse-alignment.perl
-
curl -L -o reverse-alignment.perl https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/scripts/generic/reverse-alignment.perl
507 Bytes
| #!/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; | |
| my $line; | |
| while ($line = <STDIN>) | |
| { | |
| chomp($line); | |
| my @toks = split(/ /, $line); | |
| foreach (my $i = 0; $i < @toks; ++$i) | |
| { | |
| my $tok = $toks[$i]; | |
| my @alignPair = split(/-/, $tok); | |
| (@alignPair == 2) or die("Something wrong"); | |
| print $alignPair[1]."-".$alignPair[0]." "; | |
| } | |
| print "\n"; | |
| } | |