summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-06-14 14:27:45 +0200
committerPatrick Simianer <p@simianer.de>2016-06-14 14:27:45 +0200
commitabcae4f39145863b4861588f885991b6dac662aa (patch)
tree18249899164ecc4ffbe51653b11551c06d304258 /server.rb
parent9df3b86e6a5b087d441c161c03a6fb3298943864 (diff)
parent1a51b3797d4c3a846e47b105a5edcb8283726651 (diff)
Merge branch 'master' of github.com:pks/lfpe
Diffstat (limited to 'server.rb')
-rwxr-xr-xserver.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/server.rb b/server.rb
index e6bf258..d25e216 100755
--- a/server.rb
+++ b/server.rb
@@ -179,6 +179,10 @@ def process_next reply
return
end
$lock = true # lock
+ if !data['name'] || data['name'] == ""
+ $status = "Error: Name not given."
+ return
+ end
if data['key'] != SESSION_KEY
$status = "Error: Key mismatch (#{data['key']}, #{SESSION_KEY})"
return
@@ -721,7 +725,7 @@ get '/summary' do
g.write data["references"][j]+"\n"
f.close
g.close
- ter_scores << (`#{CDEC}/mteval/fast_score -i #{f.path} -r #{g.path} -m ter 2>/dev/null`.to_f).round(2)
+ ter_scores << [1.0, (`#{CDEC}/mteval/fast_score -i #{f.path} -r #{g.path} -m ter 2>/dev/null`.to_f).round(2)].min
f.unlink
g.unlink
}