summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-06-28 13:50:20 +0200
committerPatrick Simianer <p@simianer.de>2015-06-28 13:50:20 +0200
commit91d68ae2079399acfb381dc14af323d1c75b6dca (patch)
treea563db5dacca8a329a753ae55663cb2207482bda /server.rb
parentd61cb146fe833c49ae33fb6477e74989bd13ea23 (diff)
extractor: drop
Diffstat (limited to 'server.rb')
-rwxr-xr-xserver.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/server.rb b/server.rb
index 8d615dc..8614e0b 100755
--- a/server.rb
+++ b/server.rb
@@ -166,7 +166,7 @@ get '/next' do # (receive post-edit, update models), send next translation
# 5c. symmetrize alignment
a = send_recv :atools, "#{a_fwd} ||| #{a_back}"
# 5d actual extractor
- send_recv :extractor, "- ||| #{source} ||| #{reference} ||| #{a}"
+ send_recv :extractor, "default_context ||| #{source} ||| #{reference} ||| #{a}"
# 6. update database
logmsg "db", "updating database"
update_database
@@ -190,8 +190,7 @@ get '/next' do # (receive post-edit, update models), send next translation
source.strip!
# 1. generate grammar for current sentence
grammar = "#{WORK_DIR}/g/#{$db['progress']}.grammar"
- msg = "- ||| #{source} ||| #{grammar}"
- send_recv :extractor, msg # FIXME: content identifier useful?
+ send_recv :extractor, "default_context ||| #{source} ||| #{grammar}"
# 2. translation
msg = "act:translate ||| <seg grammar=\"#{grammar}\"> #{source} </seg>"
transl = send_recv :dtrain, msg
@@ -266,6 +265,14 @@ get '/reset_weights' do
return "done"
end
+get '/reset_extractor' do
+ logmsg :server, "reset extractor"
+ return "locked" if $lock
+ send_recv :extractor, "default_context ||| drop"
+
+ return "done"
+end
+
get '/load/:name' do # load other db file than configured
return "locked" if $lock
$db = JSON.parse ReadFile.read "#{SESSION_DIR}/#{params[:name]}.json.original"