add use warnings to all perl scripts

This commit is contained in:
Hieu Hoang 2015-04-13 20:42:33 +04:00
parent 05b31b53f2
commit 6162223690
127 changed files with 137 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";
use FindBin qw($RealBin);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use Getopt::Std;
getopts('q');

View File

@ -1,5 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
use strict;
my $file = shift(@ARGV);
open(MYFILE, $file);

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
#input hindi word urdu word, delete all those entries that have number on any side
use warnings;
use utf8;
use Getopt::Std;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use utf8;
require Encode;
use IO::Handle;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use utf8;
use strict;
use Getopt::Long "GetOptions";

View File

@ -14,6 +14,7 @@ use utf8;
# 23.01.2010: added NIST p-value and interval computation
###############################################
use warnings;
use strict;
#constants

View File

@ -4,6 +4,7 @@
#sentence-by-sentence: take in a system output, with any number of factors, and a reference translation, also maybe with factors, and show each sentence and its errors
#usage: sentence-by-sentence SYSOUT [REFERENCE]+ > sentences.html
use warnings;
use strict;
use Getopt::Long;

View File

@ -4,6 +4,7 @@
# Script to convert MOSES searchgraph to DOT format
#
use warnings;
use strict;
use File::Path;
use File::Basename;

View File

@ -5,7 +5,9 @@
#usage: show-phrases-used DECODER_OUTFILE > output.html
# where DECODER_OUTFILE is the output of moses with the -T (show alignments) option
use warnings;
use strict;
BEGIN
{
my $wd= `pawd 2>/dev/null`;

View File

@ -9,6 +9,7 @@
#similar function to filter-model-given-input.pl, but only operates
#on the phrase table and doesn't require that any subdirectories exist
use warnings;
use strict;
my $MAX_LENGTH = 10;

View File

@ -3,6 +3,7 @@
# Experiment Management System
# Documentation at http://www.statmt.org/moses/?n=FactoredTraining.EMS
use warnings;
use strict;
use Getopt::Long "GetOptions";
use FindBin qw($RealBin);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my ($file,$step) = @ARGV;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
# Create domain file from corpora

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
# Build necessary files for sparse lexical features

View File

@ -2,6 +2,7 @@
# $Id: consolidate-training-data.perl 928 2009-09-02 02:58:01Z philipp $
use warnings;
use strict;
my ($in,$out,$consolidated,@PART) = @ARGV;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $cores = 8;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $jobs = 20;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
die("ERROR syntax: input-from-sgm.perl < in.sgm > in.txt")

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use IPC::Open3;
use File::Temp qw/tempdir/;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use FindBin qw($RealBin);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
#

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my ($indomain_source,,$indomain_target,$outdomain_source,$outdomain_target,$lm_training,$lm_binarizer,$order,$lm_settings,$line_count,$model);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my ($source_file,$target_file,$alignment_factors) = @ARGV;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
die("ERROR syntax: reference-from-sgm.perl ref src out")

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
$|++;

View File

@ -2,6 +2,7 @@
# $Id: report-experiment-scores.perl 407 2008-11-10 14:43:31Z philipp $
use warnings;
use strict;
my $email;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
die("ERROR: syntax: run-command-on-multiple-refsets.perl cmd in out")

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use File::Temp qw/ tempfile tempdir /;

View File

@ -6,6 +6,7 @@ binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
use warnings;
use FindBin qw($RealBin);
use strict;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Cwd;
use FindBin qw($RealBin);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";
use FindBin qw($RealBin);

View File

@ -1,5 +1,7 @@
#!/usr/bin/env perl
use warnings;
# experiment.perl support script
# get filtered rule and reordering tables and place them into a configuration file

View File

@ -1,5 +1,7 @@
#!/usr/bin/env perl
use warnings;
# experiment.perl support script
# get filtered rule and reordering tables and place them into a configuration file

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
die("ERROR: syntax is fastalign2bal.perl direct-alignment inverse-alignment source-file target-file out-stem symmetrization-method symal\n") unless scalar(@ARGV) == 7;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my ($language,$src,$system) = @ARGV;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Date::Parse;

View File

@ -3,6 +3,7 @@
binmode( STDIN, ":utf8" );
binmode( STDOUT, ":utf8" );
use warnings;
use strict;
use FindBin qw($RealBin);
use File::Basename;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -6,6 +6,7 @@
#factor indices start at 0
#factor indices too large ought to be ignored
use warnings;
use strict;
my ($filename, @factors) = @ARGV;

View File

@ -3,6 +3,7 @@
# example
# ./extract-parallel.perl 8 ./coreutils-8.9/src/split "./coreutils-8.9/src/sort --batch-size=253" ./extract ./corpus.5.en ./corpus.5.ar ./align.ar-en.grow-diag-final-and ./extracted 7 --NoFileLimit orientation --GZOutput
use warnings;
use strict;
use File::Basename;

View File

@ -5,6 +5,7 @@
# Some rudimentary sanity checks are done on the fly.
# Ondrej Bojar, bojar@ufal.mff.cuni.cz
use warnings;
use strict;
my $errs = 0;

View File

@ -8,6 +8,7 @@
# Note that the output format may not contain any spaces.
# Ondrej Bojar, bojar@ufal.mff.cuni.cz
use warnings;
use strict;
use Getopt::Long;

View File

@ -2,6 +2,7 @@
# A very simple script that converts fsal back to fsa format (openfst lattices)
# Ondrej Bojar, bojar@ufal.mff.cuni.cz
use warnings;
use strict;
while (<>) {

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;

View File

@ -3,6 +3,7 @@
# example
# ~/giza-parallel.perl 10 split ~/workspace/sourceforge/trunk/scripts/training/train-model.perl ar en train align
use warnings;
use strict;
use File::Basename;

View File

@ -4,6 +4,8 @@
#lopar2pos: extract POSs from LOPAR output
#usage: lopar2pos.pl CORPUS.lopar > CORPUS.pos
use warnings;
my $infilename = shift @ARGV;
open(INFILE, "<$infilename") or die "couldn't open '$infilename' for read: $!\n";
while(my $line = <INFILE>)

View File

@ -15,6 +15,7 @@
# added checks for existence of decoder and configuration file
# 26 Jul 2006 fix a bug related to the use of absolute path for srcfile and nbestfile
use warnings;
use strict;
#######################

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use utf8;
use Encode;

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
# $Id$
use warnings;
use strict;
my $lowercase = 0;

View File

@ -7,6 +7,7 @@ package ph_numbers;
#
# (c) 2013 TAUS
use warnings;
use strict;
run() unless caller();

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
# $Id$
use warnings;
use strict;
#######################

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $line;

View File

@ -4,6 +4,7 @@
# ./score-parallel.perl 8 "gsort --batch-size=253" ./score ./extract.2.sorted.gz ./lex.2.f2e ./phrase-table.2.half.f2e --GoodTuring ./phrase-table.2.coc 0
# ./score-parallel.perl 8 "gsort --batch-size=253" ./score ./extract.2.inv.sorted.gz ./lex.2.e2f ./phrase-table.2.half.e2f --Inverse 1
use warnings;
use strict;
use File::Basename;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
while (my $line = <STDIN>) {

View File

@ -10,6 +10,7 @@
# irst-dir = /Users/hieu/workspace/irstlm/trunk/bin
# Set smoothing method in settings, if different from modified Kneser-Ney
use warnings;
use strict;
use FindBin qw($RealBin);
use Getopt::Long;

View File

@ -9,6 +9,7 @@
# It should point to the binary file
# lmplz = /home/waziz/workspace/github/moses/bin/lmplz
use warnings;
use strict;
use FindBin qw($RealBin);
use Getopt::Long qw/GetOptionsFromArray/;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use File::Basename;
use FindBin qw($RealBin);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -6,6 +6,7 @@
#
# Ondrej Bojar, bojar@ufal.mff.cuni.cz
use warnings;
use strict;
use Getopt::Long;
use CGI;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
# $Id$
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
# $Id$
use warnings;
use strict;
use FindBin qw($Bin);
use Getopt::Long "GetOptions";

View File

@ -8,6 +8,7 @@
# --possiblyUseFirstToken : boolean option; the default behaviour (when this option is not provided) is that the first token of a sentence is ignored, on the basis that the first word of a sentence is always capitalized; if this option is provided then: a) if a sentence-initial token is *not* capitalized, then it is counted, and b) if a capitalized sentence-initial token is the only token of the segment, then it is counted, but with only 10% of the weight of a normal token.
#
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,6 +1,8 @@
#!/usr/bin/env perl
# $Id: train-recaser.perl 1326 2007-03-26 05:44:27Z bojar $
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my ($results, $truth) = @ARGV;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesScriptsRegressionTesting;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $argv=join(" ",@ARGV);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my %opt = ();

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesScriptsRegressionTesting;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use Getopt::Long;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
while(<STDIN>) {

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
while(<STDIN>) {

View File

@ -7,6 +7,8 @@
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
use warnings;
use strict;
use utf8; # tell perl this script file is in UTF-8 (see all funny punct below)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
while(<STDIN>) {

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
binmode(STDIN, ":utf8");

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $language = "en";

View File

@ -4,6 +4,7 @@
# Start by Ulrich Germann, after noticing systematic preprocessing errors
# in some of the English Europarl data.
use warnings;
use strict;
use Getopt::Std;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use utf8;
binmode(STDIN, ":utf8");

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
#binmode(STDIN, ":utf8");

View File

@ -16,6 +16,7 @@ use warnings;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
use warnings;
use FindBin qw($RealBin);
use strict;
use Time::HiRes;

View File

@ -14,6 +14,7 @@
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
use warnings;
use FindBin qw($RealBin);
use strict;
use Time::HiRes;

View File

@ -6,6 +6,8 @@
#
# Ondrej Bojar.
use warnings;
my $ini = shift;
die "usage: absolutize_moses_model.pl path-to-moses.ini > moses.abs.ini"
if !defined $ini;

View File

@ -4,6 +4,7 @@
# Binarize a Moses model
#
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
# $Id$
use warnings;
use strict;
use Getopt::Long "GetOptions";

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";
use FindBin qw($RealBin);

View File

@ -1,6 +1,7 @@
#!/usr/bin/env perl
# $Id: clean-corpus-n.perl 3633 2010-10-21 09:49:27Z phkoehn $
use warnings;
use strict;
use Getopt::Long;
my $help;

View File

@ -5,6 +5,7 @@
# in the current directory
# All relevant files are hardlinked or copied to the directory, too.
use warnings;
use strict;
use Getopt::Long;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $header = "";

View File

@ -2,6 +2,7 @@
# $Id: consolidate-training-data.perl 928 2009-09-02 02:58:01Z philipp $
use warnings;
use strict;
my ($in,$out,@PART) = @ARGV;

View File

@ -2,6 +2,7 @@
# $Id$
use warnings;
use strict;
my @LINE = <STDIN>;

View File

@ -8,6 +8,7 @@
# changes by Ondrej Bojar
# adapted for hierarchical models by Phil Williams
use warnings;
use strict;
use FindBin qw($RealBin);

View File

@ -1,5 +1,6 @@
#!/usr/bin/env perl
use warnings;
use strict;
use FindBin qw($RealBin);
BEGIN { require "$RealBin/LexicalTranslationModel.pm"; "LexicalTranslationModel"->import; }

Some files were not shown because too many files have changed in this diff Show More