summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-05-27 19:19:06 +0200
committerPatrick Simianer <p@simianer.de>2015-05-27 19:19:06 +0200
commit4e5ead06642714990b054ecf68f88b79dbd7b489 (patch)
treeabdc8976504d48533daced3001fecc9eb469388e /server.rb
parente820e38159390093cdcbf08b2f1a8b7eb0632278 (diff)
bits & pieces
Diffstat (limited to 'server.rb')
-rwxr-xr-xserver.rb4
1 files changed, 3 insertions, 1 deletions
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