summaryrefslogtreecommitdiff
path: root/add-seg
diff options
context:
space:
mode:
Diffstat (limited to 'add-seg')
-rwxr-xr-xadd-seg13
1 files changed, 6 insertions, 7 deletions
diff --git a/add-seg b/add-seg
index 14b8b6b..3825494 100755
--- a/add-seg
+++ b/add-seg
@@ -1,12 +1,12 @@
#!/usr/bin/env ruby
-require 'optimist'
-require 'zipf'
+require "optimist"
+require "zipf"
o = Optimist::options do
- opt :grammar, "(Absolute) path of folder containing grammars.", :type => :string, :short => '-g', :default => nil
+ 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'
+ opt :start_id, "start with this id", :type => :int, :default => 0, :short => "-i"
opt :nogz, "grammar files not gzipped", :type => :bool, :default => false
opt :index, "number according to index", :type => :string, :default => nil
end
@@ -19,8 +19,8 @@ end
i = o[:start_id]
j = 0
while line = STDIN.gets
- ext = '.gz'
- ext = '' if o[:nogz]
+ ext = ".gz"
+ ext = "" if o[:nogz]
s = "<seg"
if o[:loo] then s += " exclude=\"#{i}\"" end
if index.size > 0
@@ -33,4 +33,3 @@ while line = STDIN.gets
i += 1
j += 1
end
-