summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <pks@pks.rocks>2019-07-28 16:39:21 +0200
committerPatrick Simianer <pks@pks.rocks>2019-07-28 16:39:21 +0200
commit71278b098dcea1a5fb8520ab08b086cded0764fe (patch)
treea9383ace41f49f7fda084756a0890bd976a6abb0
parent1fd4762a41cf84d9b6ebe9ed4dcf83cde78f61d3 (diff)
trollop -> optimist
-rwxr-xr-xadd-seg4
-rwxr-xr-xavg4
-rwxr-xr-xavg-weights4
-rwxr-xr-xbitext-filter-length4
-rwxr-xr-xcma4
-rwxr-xr-xinv4
-rwxr-xr-xkbest-bleu-oracles4
-rwxr-xr-xkmeans4
-rwxr-xr-xlin-reg4
-rwxr-xr-xlog-reg4
-rwxr-xr-xmerge-ttable4
-rwxr-xr-xmin-max4
-rwxr-xr-xng4
13 files changed, 26 insertions, 26 deletions
diff --git a/add-seg b/add-seg
index e5db580..14b8b6b 100755
--- a/add-seg
+++ b/add-seg
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
-require 'trollop'
+require 'optimist'
require 'zipf'
-o = Trollop::options do
+o = Optimist::options do
opt :grammar, "(Absolute) path of folder containing grammars.", :type => :string, :short => '-g', :default => nil
opt :loo, "leave one out", :type => :bool, :default => false
opt :start_id, "start with this id", :type => :int, :default => 0, :short => '-i'
diff --git a/avg b/avg
index db5035a..5d32bb8 100755
--- a/avg
+++ b/avg
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
-require 'trollop'
+require 'optimist'
-conf = Trollop::options do
+conf = Optimist::options do
banner "avg < <one number per line>"
opt :round, "Number of digits after decimal point.", :type => :int, :default => -1
end
diff --git a/avg-weights b/avg-weights
index 36b051a..f090da9 100755
--- a/avg-weights
+++ b/avg-weights
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby
require 'zipf'
-require 'trollop'
+require 'optimist'
require 'zlib'
-conf = Trollop::options do
+conf = Optimist::options do
opt :weights_files, "a number of weights files: name value", :required => true
opt :filter, "Filter if key does not appear in every file.", :type => :bool, :default => false
end
diff --git a/bitext-filter-length b/bitext-filter-length
index 9e65454..d1dc973 100755
--- a/bitext-filter-length
+++ b/bitext-filter-length
@@ -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 :inputs, "inputs, comma separated", :type => :string, :short => "-i", :required => true
opt :output_suffix, "output suffix", :type => :string, :default => ".out", :short => "-S"
opt :output_index, "output index", :type => :bool, :default => false, :short => "-J"
diff --git a/cma b/cma
index 9133a0d..e0fed61 100755
--- a/cma
+++ b/cma
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
-require 'trollop'
+require 'optimist'
-conf = Trollop::options do
+conf = Optimist::options do
banner "cma < <one number per line>"
opt :round, "Number of digits after decimal point.", :type => :int, :default => -1
end
diff --git a/inv b/inv
index 50ad9cb..b13443f 100755
--- a/inv
+++ b/inv
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
-require 'trollop'
+require 'optimist'
def main
- conf = Trollop::options do
+ conf = Optimist::options do
opt :only_low, "inverse only for values < 1.0", :type => :bool, :default => false, :short => "-l"
opt :only_high, "inverse only for values > 1.0", :type => :bool, :default => false, :short => "-h"
end
diff --git a/kbest-bleu-oracles b/kbest-bleu-oracles
index a36c345..ea76ab1 100755
--- a/kbest-bleu-oracles
+++ b/kbest-bleu-oracles
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
require 'zipf'
-require 'trollop'
+require 'optimist'
def get_context kbest_lists, references, n
a = []
@@ -12,7 +12,7 @@ def get_context kbest_lists, references, n
end
def main
- conf = Trollop::options do
+ conf = Optimist::options do
opt :kbest_lists, "kbest lists", :type => :string, :required => true
opt :references, "reference", :type => :string, :required => true
opt :n, "N for BLEU", :type => :int, :default => 4
diff --git a/kmeans b/kmeans
index c1684ee..dcf7774 100755
--- a/kmeans
+++ b/kmeans
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
require 'zipf'
-require 'trollop'
+require 'optimist'
def read_data fn
data = {}
@@ -57,7 +57,7 @@ def update assignment, data
end
def main
- conf = Trollop::options do
+ conf = Optimist::options do
opt :k, "k", :type => :int, :required => true
opt :input, "input: one feature vector per line", :type => :string, :required => true
opt :max_iterations, "max. number of iterations", :type => :int, :default => 100
diff --git a/lin-reg b/lin-reg
index 7a8e614..87dded5 100755
--- a/lin-reg
+++ b/lin-reg
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
require 'zipf'
-require 'trollop'
+require 'optimist'
def read_data fn, scale
f = ReadFile.new fn
@@ -24,7 +24,7 @@ def read_data fn, scale
end
def main
- conf = Trollop::options do
+ conf = Optimist::options do
opt :input, "input data", :type => :string, :required => true
opt :output, "output data", :type => :string, :required => true
opt :learning_rate, "learning rate", :type => :float, :default => 0.07
diff --git a/log-reg b/log-reg
index 82dc353..5e43555 100755
--- a/log-reg
+++ b/log-reg
@@ -2,7 +2,7 @@
require 'zipf'
require 'matrix'
-require 'trollop'
+require 'optimist'
def read_data fn
f = ReadFile.new fn
@@ -36,7 +36,7 @@ def approx_eql x, y, eps=10**-10
end
def main
- conf = Trollop::options do
+ conf = Optimist::options do
opt :input, "input data", :type => :string, :required => true
opt :output, "1/0 output data", :type => :string, :required => true
end
diff --git a/merge-ttable b/merge-ttable
index ac10903..77eae9f 100755
--- a/merge-ttable
+++ b/merge-ttable
@@ -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 :f, "f files", :type => :string, :required => true
opt :e, "e files", :type => :string, :required => true
end
diff --git a/min-max b/min-max
index 1dbfd40..f6c8d00 100755
--- a/min-max
+++ b/min-max
@@ -1,9 +1,9 @@
#!/usr/bin/ruby
require 'zipf'
-require 'trollop'
+require 'optimist'
-conf = Trollop::options do
+conf = Optimist::options do
opt :min, "minimum #tokens", :type => :int, :default => 1
opt :max, "maximum #tokens", :type => :int, :default => 80, :short => '-n'
opt :in_f, "input 'French' file", :type => :string, :required => true
diff --git a/ng b/ng
index 7a3552f..f3a031d 100755
--- a/ng
+++ b/ng
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
require 'zipf'
-require 'trollop'
+require 'optimist'
-conf = Trollop::options do
+conf = Optimist::options do
banner "ng < <input>"
opt :n, "n for Ngrams", :type => :int, :default => 4
opt :fix, "Don't output lower order Ngrams.", :type => :bool, :default => false