summaryrefslogtreecommitdiff
path: root/add-seg
diff options
context:
space:
mode:
authorPatrick Simianer <patrick@lilt.com>2026-02-26 10:05:59 +0000
committerPatrick Simianer <patrick@lilt.com>2026-02-26 10:05:59 +0000
commitb31ace79ea5f6b3f279c544cd3a443d6fbf2a24d (patch)
tree31f2b599fa5f6996aeb134390d58deb63eefe04a /add-seg
parent8805e95ae94d798c6441f7e1b72c90e049563f17 (diff)
overhaulHEADmaster
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
-