From 65e999da12ea6d88e7703a89932b30b9ccbfcdb6 Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Thu, 5 Sep 2013 11:26:22 -0700 Subject: Unbuffered mode, flush after each line where possible, skip otherwise --- corpus/support/fix-contract.pl | 2 ++ corpus/support/quote-norm.pl | 1 + corpus/support/tokenizer.pl | 1 + corpus/support/utf8-normalize.sh | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'corpus/support') diff --git a/corpus/support/fix-contract.pl b/corpus/support/fix-contract.pl index f1e191ab..49e88981 100755 --- a/corpus/support/fix-contract.pl +++ b/corpus/support/fix-contract.pl @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +$|++; + use strict; while(<>) { #s/ (pre|anti|re|pro|inter|intra|multi|e|x|neo) - / $1- /ig; diff --git a/corpus/support/quote-norm.pl b/corpus/support/quote-norm.pl index b104e73c..57f4ad77 100755 --- a/corpus/support/quote-norm.pl +++ b/corpus/support/quote-norm.pl @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +$|++; use strict; use utf8; binmode(STDIN,"utf8"); diff --git a/corpus/support/tokenizer.pl b/corpus/support/tokenizer.pl index acc537fb..e0df16a7 100755 --- a/corpus/support/tokenizer.pl +++ b/corpus/support/tokenizer.pl @@ -1,4 +1,5 @@ #!/usr/bin/env perl +$|++; my $script_dir; BEGIN {$^W = 1; use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; } diff --git a/corpus/support/utf8-normalize.sh b/corpus/support/utf8-normalize.sh index 2f347854..c85ae9f7 100755 --- a/corpus/support/utf8-normalize.sh +++ b/corpus/support/utf8-normalize.sh @@ -25,7 +25,8 @@ else fi fi -perl -e 'while(<>){s/\r\n*/\n/g; print;}' | $CMD | /usr/bin/perl -w -e ' +perl -e '$|++; while(<>){s/\r\n*/\n/g; print;}' | $CMD | /usr/bin/perl -w -e ' + $|++; while (<>) { chomp; s/[\x00-\x1F]+/ /g; -- cgit v1.2.3