From db6a6ecfa350cae29739c59df1210d8f76a479c9 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Thu, 5 Dec 2013 07:56:38 +0100 Subject: init --- add_seg | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 add_seg (limited to 'add_seg') diff --git a/add_seg b/add_seg new file mode 100755 index 0000000..e661b40 --- /dev/null +++ b/add_seg @@ -0,0 +1,32 @@ +#!/usr/bin/env ruby + +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 + 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] +while line = STDIN.gets + ext = '.gz' + ext = '' if opts[:nogz] + s = " #{line.strip} " + i+=1 +end + -- cgit v1.2.3