mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Reduction in number of #ifdef HAVE_XMLRPC_C, as per Hieu's request.
This commit is contained in:
parent
c435e46560
commit
ec1ef78d51
@ -1,4 +1,4 @@
|
|||||||
// -*- c++ -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
||||||
// A class to store "local" information (such as task-specific caches).
|
// A class to store "local" information (such as task-specific caches).
|
||||||
// The idea is for each translation task to have a scope, which stores
|
// The idea is for each translation task to have a scope, which stores
|
||||||
// shared pointers to task-specific objects such as caches and priors.
|
// shared pointers to task-specific objects such as caches and priors.
|
||||||
@ -14,16 +14,12 @@
|
|||||||
|
|
||||||
// for some reason, the xmlrpc_c headers must be included AFTER the
|
// for some reason, the xmlrpc_c headers must be included AFTER the
|
||||||
// boost thread-related ones ...
|
// boost thread-related ones ...
|
||||||
#ifdef HAVE_XMLRPC_C
|
#include "xmlrpc-c.h"
|
||||||
#include <xmlrpc-c/base.hpp>
|
|
||||||
#include <xmlrpc-c/registry.hpp>
|
|
||||||
#include <xmlrpc-c/server_abyss.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
// #include "thread_safe_container.h"
|
#include "TypeDef.h"
|
||||||
|
#include "Util.h"
|
||||||
|
|
||||||
namespace Moses
|
namespace Moses
|
||||||
{
|
{
|
||||||
@ -40,25 +36,6 @@ protected:
|
|||||||
#endif
|
#endif
|
||||||
SPTR<std::map<std::string,float> const> m_context_weights;
|
SPTR<std::map<std::string,float> const> m_context_weights;
|
||||||
public:
|
public:
|
||||||
// class write_access
|
|
||||||
// {
|
|
||||||
// boost::unique_lock<boost::shared_mutex> m_lock;
|
|
||||||
// public:
|
|
||||||
|
|
||||||
// write_access(boost::shared_mutex& lock)
|
|
||||||
// : m_lock(lock)
|
|
||||||
// { }
|
|
||||||
|
|
||||||
// write_access(write_access& other)
|
|
||||||
// {
|
|
||||||
// swap(m_lock, other.m_lock);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// write_access lock() const
|
|
||||||
// {
|
|
||||||
// return write_access(m_lock);
|
|
||||||
// }
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
boost::shared_ptr<void> const&
|
boost::shared_ptr<void> const&
|
||||||
@ -109,22 +86,10 @@ public:
|
|||||||
m_scratchpad = other.m_scratchpad;
|
m_scratchpad = other.m_scratchpad;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
SPTR<std::map<std::string,float> const>
|
SPTR<std::map<std::string,float> const>
|
||||||
GetContextWeights(xmlrpc_c::value const* spec = NULL) {
|
GetContextWeights() {
|
||||||
if (spec && m_context_weights == NULL) {
|
|
||||||
boost::unique_lock<boost::shared_mutex> lock(m_lock);
|
|
||||||
SPTR<std::map<std::string,float> > M(new std::map<std::string, float>);
|
|
||||||
|
|
||||||
typedef std::map<std::string,xmlrpc_c::value> tmap;
|
|
||||||
tmap const tmp = static_cast<tmap>(xmlrpc_c::value_struct(*spec));
|
|
||||||
for(tmap::const_iterator m = tmp.begin(); m != tmp.end(); ++m)
|
|
||||||
(*M)[m->first] = xmlrpc_c::value_double(m->second);
|
|
||||||
m_context_weights = M;
|
|
||||||
}
|
|
||||||
return m_context_weights;
|
return m_context_weights;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SetContextWeights(std::string const& spec) {
|
SetContextWeights(std::string const& spec) {
|
||||||
@ -147,7 +112,9 @@ public:
|
|||||||
bool
|
bool
|
||||||
SetContextWeights(SPTR<std::map<std::string,float> const> const& w) {
|
SetContextWeights(SPTR<std::map<std::string,float> const> const& w) {
|
||||||
if (m_context_weights) return false;
|
if (m_context_weights) return false;
|
||||||
|
#ifdef WITH_THREADS
|
||||||
boost::unique_lock<boost::shared_mutex> lock(m_lock);
|
boost::unique_lock<boost::shared_mutex> lock(m_lock);
|
||||||
|
#endif
|
||||||
m_context_weights = w;
|
m_context_weights = w;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -60,13 +60,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ExportInterface.h"
|
#include "ExportInterface.h"
|
||||||
#ifdef HAVE_XMLRPC_C
|
#include "moses/server/Server.h"
|
||||||
#include <xmlrpc-c/base.hpp>
|
|
||||||
#include <xmlrpc-c/registry.hpp>
|
|
||||||
#include <xmlrpc-c/server_abyss.hpp>
|
|
||||||
#include "server/Server.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Moses;
|
using namespace Moses;
|
||||||
|
|
||||||
@ -148,6 +142,9 @@ run_as_server()
|
|||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
MosesServer::Server server(params);
|
MosesServer::Server server(params);
|
||||||
return server.run(); // actually: don't return. see Server::run()
|
return server.run(); // actually: don't return. see Server::run()
|
||||||
|
#else
|
||||||
|
UTIL_THROW2("Moses was compiled without xmlrpc-c. "
|
||||||
|
<< "No server functionality available.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,10 +226,8 @@ batch_run()
|
|||||||
if (context_window)
|
if (context_window)
|
||||||
task->SetContextWindow(context_window);
|
task->SetContextWindow(context_window);
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
if (context_weights != "" && !task->GetScope()->GetContextWeights())
|
if (context_weights != "" && !task->GetScope()->GetContextWeights())
|
||||||
task->GetScope()->SetContextWeights(context_weights);
|
task->GetScope()->SetContextWeights(context_weights);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Allow for (sentence-)context-specific processing prior to
|
// Allow for (sentence-)context-specific processing prior to
|
||||||
// decoding. This can be used, for example, for context-sensitive
|
// decoding. This can be used, for example, for context-sensitive
|
||||||
|
@ -811,11 +811,9 @@ namespace Moses
|
|||||||
Mmsapt::
|
Mmsapt::
|
||||||
setup_bias(ttasksptr const& ttask)
|
setup_bias(ttasksptr const& ttask)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
|
|
||||||
// VERBOSE(2,"Setting up bias at " << HERE << std::endl);
|
|
||||||
SPTR<ContextScope> const& scope = ttask->GetScope();
|
SPTR<ContextScope> const& scope = ttask->GetScope();
|
||||||
SPTR<ContextForQuery> context = scope->get<ContextForQuery>(btfix.get(), true);
|
SPTR<ContextForQuery> context;
|
||||||
|
context = scope->get<ContextForQuery>(btfix.get(), true);
|
||||||
if (context->bias) return;
|
if (context->bias) return;
|
||||||
|
|
||||||
// bias weights specified with the session?
|
// bias weights specified with the session?
|
||||||
@ -853,7 +851,6 @@ namespace Moses
|
|||||||
context->bias_log = m_bias_log;
|
context->bias_log = m_bias_log;
|
||||||
context->bias->loglevel = m_bias_loglevel;
|
context->bias->loglevel = m_bias_loglevel;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -90,7 +90,6 @@ namespace Moses
|
|||||||
if (!output.update(param)) return false;
|
if (!output.update(param)) return false;
|
||||||
return sanity_check();
|
return sanity_check();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -35,10 +35,7 @@ namespace Moses
|
|||||||
AllOptions() {}
|
AllOptions() {}
|
||||||
AllOptions(Parameter const& param);
|
AllOptions(Parameter const& param);
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
bool update(std::map<std::string,xmlrpc_c::value>const& param);
|
bool update(std::map<std::string,xmlrpc_c::value>const& param);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool NBestDistinct() const;
|
bool NBestDistinct() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -18,10 +18,8 @@ namespace Moses
|
|||||||
CubePruningOptions(Parameter const& param);
|
CubePruningOptions(Parameter const& param);
|
||||||
CubePruningOptions() {};
|
CubePruningOptions() {};
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
bool
|
bool
|
||||||
update(std::map<std::string,xmlrpc_c::value>const& params);
|
update(std::map<std::string,xmlrpc_c::value>const& params);
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,7 @@ struct NBestOptions : public OptionsBaseClass
|
|||||||
|
|
||||||
bool init(Parameter const& param);
|
bool init(Parameter const& param);
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
bool update(std::map<std::string,xmlrpc_c::value>const& param);
|
bool update(std::map<std::string,xmlrpc_c::value>const& param);
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
|
||||||
#include "OptionsBaseClass.h"
|
#include "OptionsBaseClass.h"
|
||||||
|
namespace Moses {
|
||||||
|
|
||||||
namespace Moses
|
|
||||||
{
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
bool
|
bool
|
||||||
OptionsBaseClass::
|
OptionsBaseClass::
|
||||||
@ -10,7 +9,9 @@ namespace Moses
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_XMLRPC_C
|
||||||
bool
|
bool
|
||||||
OptionsBaseClass::
|
OptionsBaseClass::
|
||||||
check(std::map<std::string, xmlrpc_c::value> const& param,
|
check(std::map<std::string, xmlrpc_c::value> const& param,
|
||||||
@ -19,7 +20,5 @@ namespace Moses
|
|||||||
std::map<std::string, xmlrpc_c::value>::const_iterator m;
|
std::map<std::string, xmlrpc_c::value>::const_iterator m;
|
||||||
return (param.find(key) != param.end());
|
return (param.find(key) != param.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifdef HAVE_XMLRPC_C
|
#include "moses/xmlrpc-c.h"
|
||||||
#include <xmlrpc-c/base.hpp>
|
|
||||||
#endif
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
namespace Moses
|
namespace Moses
|
||||||
@ -12,10 +10,9 @@ namespace Moses
|
|||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
virtual bool
|
virtual bool
|
||||||
update(std::map<std::string,xmlrpc_c::value>const& params);
|
update(std::map<std::string,xmlrpc_c::value>const& params);
|
||||||
|
#endif
|
||||||
bool
|
bool
|
||||||
check(std::map<std::string, xmlrpc_c::value> const& param,
|
check(std::map<std::string, xmlrpc_c::value> const& param,
|
||||||
std::string const key);
|
std::string const key);
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -68,10 +68,11 @@ namespace Moses {
|
|||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
bool
|
bool
|
||||||
ReportingOptions::
|
ReportingOptions::
|
||||||
update(std::map<std::string,xmlrpc_c::value>const& param)
|
update(std::map<std::string, xmlrpc_c::value>const& param)
|
||||||
{
|
{
|
||||||
ReportAllFactors = check(param, "report-all-factors");
|
ReportAllFactors = check(param, "report-all-factors");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,8 @@ namespace Moses
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
bool update(std::map<std::string,xmlrpc_c::value>const& param);
|
bool update(std::map<std::string, xmlrpc_c::value>const& param);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,10 +43,8 @@ namespace Moses
|
|||||||
return early_discarding_threshold != -std::numeric_limits<float>::infinity();
|
return early_discarding_threshold != -std::numeric_limits<float>::infinity();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
bool
|
bool
|
||||||
update(std::map<std::string,xmlrpc_c::value>const& params);
|
update(std::map<std::string,xmlrpc_c::value>const& params);
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
#include "PackScores.h"
|
#include "PackScores.h"
|
||||||
#include "moses/FF/StatefulFeatureFunction.h"
|
#include "moses/FF/StatefulFeatureFunction.h"
|
||||||
#include "moses/FF/StatelessFeatureFunction.h"
|
#include "moses/FF/StatelessFeatureFunction.h"
|
||||||
@ -44,5 +43,3 @@ PackScores(ScoreComponentCollection const& S)
|
|||||||
return xmlrpc_c::value_struct(M);
|
return xmlrpc_c::value_struct(M);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <xmlrpc-c/base.hpp>
|
#include <xmlrpc-c/base.hpp>
|
||||||
#include "moses/FF/FeatureFunction.h"
|
#include "moses/FF/FeatureFunction.h"
|
||||||
#include "moses/ScoreComponentCollection.h"
|
#include "moses/ScoreComponentCollection.h"
|
||||||
|
|
||||||
namespace Moses {
|
namespace Moses {
|
||||||
|
xmlrpc_c::value
|
||||||
xmlrpc_c::value
|
PackScores(ScoreComponentCollection const& S);
|
||||||
PackScores(ScoreComponentCollection const& S);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
||||||
#include "Server.h"
|
#include "Server.h"
|
||||||
|
|
||||||
namespace MosesServer
|
namespace MosesServer
|
||||||
{
|
{
|
||||||
Server::
|
Server::
|
||||||
Server(Moses::Parameter& params)
|
Server(Moses::Parameter& params)
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
: m_server_options(params),
|
: m_server_options(params),
|
||||||
m_updater(new Updater),
|
m_updater(new Updater),
|
||||||
m_optimizer(new Optimizer),
|
m_optimizer(new Optimizer),
|
||||||
@ -17,15 +15,11 @@ namespace MosesServer
|
|||||||
m_registry.addMethod("optimize", m_optimizer);
|
m_registry.addMethod("optimize", m_optimizer);
|
||||||
m_registry.addMethod("close_session", m_close_session);
|
m_registry.addMethod("close_session", m_close_session);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
{ }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Server::
|
Server::
|
||||||
run()
|
run()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
xmlrpc_c::serverAbyss myAbyssServer
|
xmlrpc_c::serverAbyss myAbyssServer
|
||||||
(xmlrpc_c::serverAbyss::constrOpt()
|
(xmlrpc_c::serverAbyss::constrOpt()
|
||||||
.registryP(&m_registry)
|
.registryP(&m_registry)
|
||||||
@ -42,12 +36,8 @@ namespace MosesServer
|
|||||||
}
|
}
|
||||||
else myAbyssServer.run();
|
else myAbyssServer.run();
|
||||||
|
|
||||||
std::cerr << "xmlrpc_c::serverAbyss.run() returned but should not." << std::endl;
|
std::cerr << "xmlrpc_c::serverAbyss.run() returned but it should not."
|
||||||
// #pragma message("BUILDING MOSES WITH SERVER SUPPORT")
|
<< std::endl;
|
||||||
#else
|
|
||||||
// #pragma message("BUILDING MOSES WITHOUT SERVER SUPPORT")
|
|
||||||
std::cerr << "Moses was compiled without server support." << std::endl;
|
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +61,4 @@ namespace MosesServer
|
|||||||
{
|
{
|
||||||
return m_session_cache.erase(session_id);
|
return m_session_cache.erase(session_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
#include "moses/TypeDef.h"
|
#include "moses/TypeDef.h"
|
||||||
|
|
||||||
#ifdef WITH_THREADS
|
#ifdef WITH_THREADS
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
#include "moses/ThreadPool.h"
|
#include "moses/ThreadPool.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <xmlrpc-c/base.hpp>
|
#include <xmlrpc-c/base.hpp>
|
||||||
#include <xmlrpc-c/registry.hpp>
|
#include <xmlrpc-c/registry.hpp>
|
||||||
#include <xmlrpc-c/server_abyss.hpp>
|
#include <xmlrpc-c/server_abyss.hpp>
|
||||||
@ -14,7 +15,6 @@
|
|||||||
#include "Updater.h"
|
#include "Updater.h"
|
||||||
#include "CloseSession.h"
|
#include "CloseSession.h"
|
||||||
#include "Session.h"
|
#include "Session.h"
|
||||||
#endif
|
|
||||||
#include "moses/parameters/ServerOptions.h"
|
#include "moses/parameters/ServerOptions.h"
|
||||||
|
|
||||||
namespace MosesServer
|
namespace MosesServer
|
||||||
@ -23,13 +23,11 @@ namespace MosesServer
|
|||||||
{
|
{
|
||||||
Moses::ServerOptions m_server_options;
|
Moses::ServerOptions m_server_options;
|
||||||
SessionCache m_session_cache;
|
SessionCache m_session_cache;
|
||||||
#ifdef HAVE_XMLRPC_C
|
|
||||||
xmlrpc_c::registry m_registry;
|
xmlrpc_c::registry m_registry;
|
||||||
xmlrpc_c::methodPtr const m_updater;
|
xmlrpc_c::methodPtr const m_updater;
|
||||||
xmlrpc_c::methodPtr const m_optimizer;
|
xmlrpc_c::methodPtr const m_optimizer;
|
||||||
xmlrpc_c::methodPtr const m_translator;
|
xmlrpc_c::methodPtr const m_translator;
|
||||||
xmlrpc_c::methodPtr const m_close_session;
|
xmlrpc_c::methodPtr const m_close_session;
|
||||||
#endif
|
|
||||||
public:
|
public:
|
||||||
Server(Moses::Parameter& params);
|
Server(Moses::Parameter& params);
|
||||||
|
|
||||||
|
@ -35,6 +35,17 @@ create(Translator* translator, xmlrpc_c::paramList const& paramList,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetContextWeights(Moses::ContextScope& s, xmlrpc_c::value const& w)
|
||||||
|
{
|
||||||
|
SPTR<std::map<std::string,float> > M(new std::map<std::string, float>);
|
||||||
|
typedef std::map<std::string,xmlrpc_c::value> tmap;
|
||||||
|
tmap const tmp = static_cast<tmap>(xmlrpc_c::value_struct(w));
|
||||||
|
for(tmap::const_iterator m = tmp.begin(); m != tmp.end(); ++m)
|
||||||
|
(*M)[m->first] = xmlrpc_c::value_double(m->second);
|
||||||
|
s.SetContextWeights(M);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TranslationRequest::
|
TranslationRequest::
|
||||||
Run()
|
Run()
|
||||||
@ -55,8 +66,8 @@ Run()
|
|||||||
|
|
||||||
// settings within the session scope
|
// settings within the session scope
|
||||||
param_t::const_iterator si = params.find("context-weights");
|
param_t::const_iterator si = params.find("context-weights");
|
||||||
if (si != params.end()) m_scope->GetContextWeights(&si->second);
|
if (si != params.end()) SetContextWeights(*m_scope, si->second);
|
||||||
|
|
||||||
Moses::StaticData const& SD = Moses::StaticData::Instance();
|
Moses::StaticData const& SD = Moses::StaticData::Instance();
|
||||||
|
|
||||||
//Make sure alternative paths are retained, if necessary
|
//Make sure alternative paths are retained, if necessary
|
||||||
|
5
moses/xmlrpc-c.h
Normal file
5
moses/xmlrpc-c.h
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#ifdef HAVE_XMLRPC_C
|
||||||
|
#include <xmlrpc-c/base.hpp>
|
||||||
|
#else
|
||||||
|
namespace xmlrpc_c { class value; }
|
||||||
|
#endif
|
@ -6,4 +6,9 @@ set -e -o pipefail
|
|||||||
|
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update regtest
|
git submodule update regtest
|
||||||
./bjam -j$(nproc) --with-irstlm=./opt --with-boost=./opt --with-cmph=./opt --with-xmlrpc-c=./opt --with-regtest=./regtest $@
|
|
||||||
|
# test compilation without xmlrpc-c
|
||||||
|
./bjam -j$(nproc) --with-irstlm=./opt --with-boost=./opt --with-cmph=./opt --no-xmlrpc-c --with-regtest=./regtest -a -q $@ || exit $?
|
||||||
|
|
||||||
|
# test compilation with xmlrpc-c
|
||||||
|
./bjam -j$(nproc) --with-irstlm=./opt --with-boost=./opt --with-cmph=./opt --with-xmlrpc-c=./opt --with-regtest=./regtest -a -q $@
|
||||||
|
Loading…
Reference in New Issue
Block a user