From 68acbb9a0c7967cb90a7e3756fc94fdd8a73d154 Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Wed, 29 Jan 2014 19:14:08 +0100
Subject: make use of nlp_ruby, LICENSE
---
add_seg | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
(limited to 'add_seg')
diff --git a/add_seg b/add_seg
index e661b40..684a236 100755
--- a/add_seg
+++ b/add_seg
@@ -2,30 +2,24 @@
require 'trollop'
-
STDIN.set_encoding 'utf-8'
STDOUT.set_encoding 'utf-8'
-def usage
- puts "addseg [--nogz] [--loo] [--grammar] \n"
- exit 1
-end
-opts = Trollop::options do
- opt :grammar, "(Abs) path of folder containing grammar.", :type => :string, :short => '-g', :required => true
+cfg = Trollop::options do
+ opt :grammar, "(Absolute) path of folder containing grammars.", :type => :string, :short => '-g', :required => true
opt :loo, "leave one out", :type => :bool, :default => false
opt :start_id, "start with this id", :type => :int, :default => 0, :short => '-i'
opt :nogz, "grammar files not gzipped", :type => :bool, :default => false
end
-
-i = opts[:start_id]
+i = cfg[:start_id]
while line = STDIN.gets
ext = '.gz'
- ext = '' if opts[:nogz]
+ ext = '' if cfg[:nogz]
s = " #{line.strip} "
i+=1
end
--
cgit v1.2.3