From 4e5ead06642714990b054ecf68f88b79dbd7b489 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Wed, 27 May 2015 19:19:06 +0200 Subject: bits & pieces --- server.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server.rb') diff --git a/server.rb b/server.rb index 86fc53f..a0dcd9c 100755 --- a/server.rb +++ b/server.rb @@ -8,6 +8,7 @@ require 'digest' require_relative "#{ARGV[0]}" INPUT = ReadFile.readlines INPUT_FILE +INPUT_RAW = ReadFile.readlines RAW_INPUT_FILE `mkdir -p #{WORK_DIR}/g` def start_daemon cmd, name, addr @@ -102,6 +103,7 @@ get '/next' do STDERR.write "[extractor] < got '#{env[:extractor][:socket].recv}'\n" end source = INPUT.shift + raw_source = INPUT_RAW.shift if !source # input is done -> displays 'Thank you!' STDERR.write ">>> end of input, sending 'fi'\n" "fi" @@ -121,7 +123,7 @@ get '/next' do STDERR.write "[dtrain] waiting for translation ...\n" transl = env[:dtrain][:socket].recv.force_encoding "UTF-8" STDERR.write "[dtrain] < received translation: '#{transl}'\n" - "#{source}\t#{transl}" + "#{source}\t#{transl.strip}\t#{raw_source}" end end -- cgit v1.2.3