diff options
author | Patrick Simianer <p@simianer.de> | 2015-06-28 13:50:20 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-06-28 13:50:20 +0200 |
commit | 91d68ae2079399acfb381dc14af323d1c75b6dca (patch) | |
tree | a563db5dacca8a329a753ae55663cb2207482bda /server.rb | |
parent | d61cb146fe833c49ae33fb6477e74989bd13ea23 (diff) |
extractor: drop
Diffstat (limited to 'server.rb')
-rwxr-xr-x | server.rb | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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" |