summaryrefslogtreecommitdiff
path: root/util/truecase.rb
diff options
context:
space:
mode:
Diffstat (limited to 'util/truecase.rb')
-rwxr-xr-xutil/truecase.rb30
1 files changed, 0 insertions, 30 deletions
diff --git a/util/truecase.rb b/util/truecase.rb
deleted file mode 100755
index 3e97bd5..0000000
--- a/util/truecase.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'nanomsg'
-require 'open3'
-require 'trollop'
-
-conf = Trollop::options do
- opt :addr, "socket address", :short => "-S", :type => :string, :required => true
- opt :moses, "path to moses directory", :short => "-m", :type => :string, :required => true
- opt :model, "model file", :short => "-n", :type => :string, :required => true
-end
-
-sock = NanoMsg::PairSocket.new
-sock.bind conf[:addr]
-sock.send "hello"
-
-cmd = "#{conf[:moses]}/scripts/recaser/truecase.perl -b --model #{conf[:model]}"
-while true
- inp = sock.recv + " " # FIXME?
- break if !inp||inp=="shutdown"
- Open3.popen3(cmd) do |pin, pout, perr|
- pin.write inp
- pin.close
- s = pout.gets.strip
- sock.send s #pout.gets.strip
- end
-end
-
-sock.send "off"
-