From bd84f0f2f1eb693ebdf56b92e2aae67cd785d7ce Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Mon, 5 Aug 2019 11:28:24 +0200 Subject: trollop -> optimist --- norm-german | 4 ++-- per-sentence-bleu | 4 ++-- per-sentence-bleu-kbest | 4 ++-- per-sentence-ter | 4 ++-- pt-bloom | 4 ++-- sample | 4 ++-- select | 4 ++-- select-from | 4 ++-- shard | 4 ++-- split-pipes | 4 ++-- stddev | 4 ++-- tf-idf | 4 ++-- train-test-split | 4 ++-- var | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/norm-german b/norm-german index cf9c060..85a39da 100755 --- a/norm-german +++ b/norm-german @@ -1,13 +1,13 @@ #!/usr/bin/env ruby require 'thread' -require 'trollop' +require 'optimist' STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' -conf = Trollop::options do +conf = Optimist::options do banner "norm_german < " opt :upper, "uppercase", :type => :bool, :default => false opt :threads, "#threads", :type => :int, :default => 1, :short => '-h' diff --git a/per-sentence-bleu b/per-sentence-bleu index e70db2b..257eb3a 100755 --- a/per-sentence-bleu +++ b/per-sentence-bleu @@ -1,10 +1,10 @@ #!/usr/bin/env ruby require 'zipf' -require 'trollop' +require 'optimist' def main - conf = Trollop::options do + conf = Optimist::options do opt :input, "input", :type => :string, :default => '-' opt :references, "references", :type => :string, :required => true opt :len_hack, "hack of Nakov et al", :type => :int, :default => 0 diff --git a/per-sentence-bleu-kbest b/per-sentence-bleu-kbest index f8bd860..dad1607 100755 --- a/per-sentence-bleu-kbest +++ b/per-sentence-bleu-kbest @@ -1,10 +1,10 @@ #!/usr/bin/env ruby require 'zipf' -require 'trollop' +require 'optimist' def main - conf = Trollop::options do + conf = Optimist::options do opt :kbests, "kbests", :type => :string, :default => '-' opt :references, "references", :type => :string, :required => true end diff --git a/per-sentence-ter b/per-sentence-ter index f2f2b20..1a7670e 100755 --- a/per-sentence-ter +++ b/per-sentence-ter @@ -1,11 +1,11 @@ #!/usr/bin/env ruby require 'zipf' -require 'trollop' +require 'optimist' require 'tempfile' def main - conf = Trollop::options do + conf = Optimist::options do opt :input, "input", :type => :string, :default => '-' opt :references, "references", :type => :string, :required => true opt :mteval_bin, "cdec's mteval/fast_score", :type => :string, :default => '`/toolbox/cdec-dtrain/mteval/fast_score' diff --git a/pt-bloom b/pt-bloom index 5c2cf01..35234f1 100755 --- a/pt-bloom +++ b/pt-bloom @@ -1,12 +1,12 @@ #!/usr/bin/env ruby require 'bloom-filter' -require 'trollop' +require 'optimist' STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' -conf = Trollop::options do +conf = Optimist::options do opt :size, "number of entries in the filter", :type => :int, :required => true opt :error_rate, "error rate", :type => :float, :default => 0.01 end diff --git a/sample b/sample index 8d3a322..aa46ddb 100755 --- a/sample +++ b/sample @@ -1,11 +1,11 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' -opts = Trollop::options do +opts = Optimist::options do banner "sample --size [--shuffle] --file " opt :size, "Sample P % or # lines from file or N.", :type => :float opt :shuffle, "Sample is shuffled.", :type => :bool diff --git a/select b/select index 9b1eaa8..36e4256 100755 --- a/select +++ b/select @@ -1,9 +1,9 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' require 'zipf' -opts = Trollop::options do +opts = Optimist::options do banner "sample --index [--shuffle] [--file ]" opt :file, "Input file.", :type => :string, :default => '-' opt :index, "Index file.", :type => :string, :required => true diff --git a/select-from b/select-from index b1fb2d8..e06e4fb 100755 --- a/select-from +++ b/select-from @@ -1,9 +1,9 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' require 'zipf' -opts = Trollop::options do +opts = Optimist::options do banner "select_from [--invert] -i < " opt :index, "Line numbers to output.", :type => :string, :short => '-i', :required => true opt :invert, "Invert selection.", :type => :bool, :short => '-j', :default => false diff --git a/shard b/shard index 6155123..5294afd 100755 --- a/shard +++ b/shard @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' def make_shards(input, refs, alignments, output_prefix, num_shards=2, rand=false) lc = `wc -l #{input}`.split.first.to_i @@ -67,7 +67,7 @@ def make_shards(input, refs, alignments, output_prefix, num_shards=2, rand=false return [in_fns, refs_fns] end -opts = Trollop::options do +opts = Optimist::options do opt :input, 'input', :type => :string, :required => true opt :references, 'references', :type => :string, :required => true opt :alignments, 'alignments', :type => :string, :required => true diff --git a/split-pipes b/split-pipes index ce8f018..862e8be 100755 --- a/split-pipes +++ b/split-pipes @@ -1,11 +1,11 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' -conf = Trollop::options do +conf = Optimist::options do banner "splitpipes -f < " opt :field, "field", :type => :int, :required => true opt :to, "to", :type => :int, :default => nil diff --git a/stddev b/stddev index 6a29e74..15c245e 100755 --- a/stddev +++ b/stddev @@ -1,8 +1,8 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' -conf = Trollop::options do +conf = Optimist::options do banner "stddev [-r ] < " opt :round, "Number of digits after decimal point.", :type => :int, :default => -1 opt :corrected, "corrected stddev", :type => :bool, :default => false diff --git a/tf-idf b/tf-idf index 066548b..22c3dac 100755 --- a/tf-idf +++ b/tf-idf @@ -1,10 +1,10 @@ #!/usr/bin/env ruby require 'zipf' -require 'trollop' +require 'optimist' def main - conf = Trollop::options do + conf = Optimist::options do opt :documents, "input files (documents)", :type => :string, :required => true opt :filter_stopwords, "filter stopwords (give file)", :type => :string, :default => nil opt :one_item_per_line, "one item per line (allow multi-word items)", :type => :bool, :default => false diff --git a/train-test-split b/train-test-split index cf52455..aa55534 100755 --- a/train-test-split +++ b/train-test-split @@ -1,9 +1,9 @@ #!/usr/bin/env ruby require 'zipf' -require 'trollop' +require 'optimist' -conf = Trollop::options do +conf = Optimist::options do opt :foreign, "foreign file", :type => :string, :required => true opt :english, "english file", :type => :string, :required => true opt :size, "one size", :type => :int, :required => true diff --git a/var b/var index 60f3b9b..8ca6082 100755 --- a/var +++ b/var @@ -1,8 +1,8 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' -conf = Trollop::options do +conf = Optimist::options do banner "stddev [-r ] < " opt :round, "Number of digits after decimal point.", :type => :int, :default => -1 end -- cgit v1.2.3