diff options
author | Patrick Simianer <pks@pks.rocks> | 2019-08-05 11:28:24 +0200 |
---|---|---|
committer | Patrick Simianer <pks@pks.rocks> | 2019-08-05 11:28:24 +0200 |
commit | bd84f0f2f1eb693ebdf56b92e2aae67cd785d7ce (patch) | |
tree | cb01f3d9f7b5726f3bde5bd46fdc623bc5913bd1 | |
parent | 43aa6586f5807aeb99d8e08f996707d92e18774e (diff) |
trollop -> optimist
-rwxr-xr-x | norm-german | 4 | ||||
-rwxr-xr-x | per-sentence-bleu | 4 | ||||
-rwxr-xr-x | per-sentence-bleu-kbest | 4 | ||||
-rwxr-xr-x | per-sentence-ter | 4 | ||||
-rwxr-xr-x | pt-bloom | 4 | ||||
-rwxr-xr-x | sample | 4 | ||||
-rwxr-xr-x | select | 4 | ||||
-rwxr-xr-x | select-from | 4 | ||||
-rwxr-xr-x | shard | 4 | ||||
-rwxr-xr-x | split-pipes | 4 | ||||
-rwxr-xr-x | stddev | 4 | ||||
-rwxr-xr-x | tf-idf | 4 | ||||
-rwxr-xr-x | train-test-split | 4 | ||||
-rwxr-xr-x | 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 < <file w/ lowercased tokens>" 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' @@ -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 @@ -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 <n> [--shuffle] --file <line separated data>" opt :size, "Sample P % or # lines from file or N.", :type => :float opt :shuffle, "Sample is shuffled.", :type => :bool @@ -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 <n> [--shuffle] [--file <line separated data>]" 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 <file> < <line separated data>" opt :index, "Line numbers to output.", :type => :string, :short => '-i', :required => true opt :invert, "Invert selection.", :type => :bool, :short => '-j', :default => false @@ -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 <n> < <input>" opt :field, "field", :type => :int, :required => true opt :to, "to", :type => :int, :default => nil @@ -1,8 +1,8 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' -conf = Trollop::options do +conf = Optimist::options do banner "stddev [-r <d>] < <one number per line>" opt :round, "Number of digits after decimal point.", :type => :int, :default => -1 opt :corrected, "corrected stddev", :type => :bool, :default => false @@ -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 @@ -1,8 +1,8 @@ #!/usr/bin/env ruby -require 'trollop' +require 'optimist' -conf = Trollop::options do +conf = Optimist::options do banner "stddev [-r <d>] < <one number per line>" opt :round, "Number of digits after decimal point.", :type => :int, :default => -1 end |