Download mosesdecoder/scripts/tokenizer/delete-long-words.perl from suricodes/hindi-sindhi-docker: direct link, hf CLI and curl.
- Browser
- Download file 310 Bytes
-
https://huggingface.co/spaces/suricodes/hindi-sindhi-docker/resolve/main/mosesdecoder/scripts/tokenizer/delete-long-words.perl
- Command line
-
hf download hf://spaces/suricodes/hindi-sindhi-docker/mosesdecoder/scripts/tokenizer/delete-long-words.perl
-
curl -L -o delete-long-words.perl https://huggingface.co/spaces/suricodes/hindi-sindhi-docker/resolve/main/mosesdecoder/scripts/tokenizer/delete-long-words.perl
310 Bytes
| #!/usr/bin/perl -w | |
| use strict; | |
| while (@ARGV) { | |
| $_ = shift; | |
| /^-b$/ && ($| = 1, next); # not buffered (flush each line) | |
| } | |
| while(<STDIN>) { | |
| chop; | |
| my $first = 1; | |
| foreach (split) { | |
| if (length($_)<200) { | |
| print " " unless $first; | |
| print $_; | |
| $first = 0; | |
| } | |
| } | |
| print "\n"; | |
| } | |