diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-08-09 22:54:58 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-08-09 22:54:58 +0300 |
commit | ab820e7b25fd4c83d630fd418e8bd6599804fa39 (patch) | |
tree | 88ef1585fa373494393e5336a319a6c1381421f7 /moses/server | |
parent | 1e82118ae9bf98e64bacb14ee83a22210462b869 (diff) |
Copy options from StaticData in constructor.
Diffstat (limited to 'moses/server')
-rw-r--r-- | moses/server/TranslationRequest.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/moses/server/TranslationRequest.cpp b/moses/server/TranslationRequest.cpp index b05330d2b..bdccd8b87 100644 --- a/moses/server/TranslationRequest.cpp +++ b/moses/server/TranslationRequest.cpp @@ -1,7 +1,7 @@ #include "TranslationRequest.h" #include "moses/ContextScope.h" #include <boost/foreach.hpp> - +#include "moses/Util.h" namespace MosesServer { using namespace std; @@ -29,7 +29,7 @@ create(Translator* translator, xmlrpc_c::paramList const& paramList, boost::mutex& mut) { boost::shared_ptr<TranslationRequest> ret; - ret.reset(new TranslationRequest(paramList,cond, mut)); + ret.reset(new TranslationRequest(paramList, cond, mut)); ret->m_self = ret; ret->m_translator = translator; return ret; @@ -49,8 +49,7 @@ Run() m_session_id = S.id; // cerr << "SESSION ID" << m_session_id << endl; } - else - m_scope.reset(new Moses::ContextScope); + else m_scope.reset(new Moses::ContextScope); Moses::StaticData const& SD = Moses::StaticData::Instance(); @@ -59,14 +58,14 @@ Run() // why on earth is this a global variable? Is this even thread-safe???? UG (const_cast<Moses::StaticData&>(SD)).SetOutputSearchGraph(true); - std::stringstream out, graphInfo, transCollOpts; - + // std::stringstream out, graphInfo, transCollOpts; + if (SD.IsSyntax()) run_chart_decoder(); else run_phrase_decoder(); - XVERBOSE(1,"Output: " << out.str() << endl); + // XVERBOSE(1,"Output: " << out.str() << endl); { boost::lock_guard<boost::mutex> lock(m_mutex); m_done = true; @@ -236,7 +235,9 @@ TranslationRequest(xmlrpc_c::paramList const& paramList, : m_cond(cond), m_mutex(mut), m_done(false), m_paramList(paramList) , m_nbestSize(0) , m_session_id(0) -{ } +{ + m_options = StaticData::Instance().options(); +} void TranslationRequest:: @@ -345,7 +346,8 @@ pack_hypothesis(vector<Hypothesis const* > const& edges, string const& key, // target string ostringstream target; BOOST_REVERSE_FOREACH(Hypothesis const* e, edges) - output_phrase(target, e->GetCurrTargetPhrase()); + output_phrase(target, e->GetCurrTargetPhrase()); + std::cerr << "SERVER TRANSLATION: " << target.str() << std::endl; dest[key] = xmlrpc_c::value_string(target.str()); if (m_withAlignInfo) { |