mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 15:04:05 +03:00
daily automatic beautifier
This commit is contained in:
parent
d59bb883dc
commit
37f7bb687e
@ -12,7 +12,7 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#endif
|
||||
|
||||
// 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 ...
|
||||
#ifdef HAVE_XMLRPC_C
|
||||
#include <xmlrpc-c/base.hpp>
|
||||
@ -111,18 +111,16 @@ public:
|
||||
|
||||
#ifdef HAVE_XMLRPC_C
|
||||
SPTR<std::map<std::string,float> >
|
||||
GetContextWeights(xmlrpc_c::value const* spec = NULL)
|
||||
{
|
||||
if (spec && m_context_weights == NULL)
|
||||
{
|
||||
boost::unique_lock<boost::shared_mutex> lock(m_lock);
|
||||
m_context_weights.reset(new std::map<std::string, float>);
|
||||
GetContextWeights(xmlrpc_c::value const* spec = NULL) {
|
||||
if (spec && m_context_weights == NULL) {
|
||||
boost::unique_lock<boost::shared_mutex> lock(m_lock);
|
||||
m_context_weights.reset(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_context_weights)[m->first] = xmlrpc_c::value_double(m->second);
|
||||
}
|
||||
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_context_weights)[m->first] = xmlrpc_c::value_double(m->second);
|
||||
}
|
||||
return m_context_weights;
|
||||
}
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ GetContextWindow() const
|
||||
return m_context;
|
||||
}
|
||||
|
||||
SPTR<std::map<std::string, float> const>
|
||||
SPTR<std::map<std::string, float> const>
|
||||
TranslationTask::GetContextWeights() const
|
||||
{
|
||||
return m_context_weights;
|
||||
|
Loading…
Reference in New Issue
Block a user