daily automatic beautifier

This commit is contained in:
MosesAdmin 2015-10-22 00:00:41 +01:00
parent d59bb883dc
commit 37f7bb687e
2 changed files with 11 additions and 13 deletions

View File

@ -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

View File

@ -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;