From 91d68ae2079399acfb381dc14af323d1c75b6dca Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 28 Jun 2015 13:50:20 +0200 Subject: extractor: drop --- server.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'server.rb') 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 ||| #{source} " 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" -- cgit v1.2.3