mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-01 16:33:16 +03:00
daily automatic beautifier
This commit is contained in:
parent
d59bb883dc
commit
37f7bb687e
@ -12,7 +12,7 @@
|
|||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#endif
|
#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 ...
|
// boost thread-related ones ...
|
||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
#include <xmlrpc-c/base.hpp>
|
#include <xmlrpc-c/base.hpp>
|
||||||
@ -111,18 +111,16 @@ public:
|
|||||||
|
|
||||||
#ifdef HAVE_XMLRPC_C
|
#ifdef HAVE_XMLRPC_C
|
||||||
SPTR<std::map<std::string,float> >
|
SPTR<std::map<std::string,float> >
|
||||||
GetContextWeights(xmlrpc_c::value const* spec = NULL)
|
GetContextWeights(xmlrpc_c::value const* spec = NULL) {
|
||||||
{
|
if (spec && m_context_weights == 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>);
|
||||||
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;
|
typedef std::map<std::string,xmlrpc_c::value> tmap;
|
||||||
tmap const tmp = static_cast<tmap>(xmlrpc_c::value_struct(*spec));
|
tmap const tmp = static_cast<tmap>(xmlrpc_c::value_struct(*spec));
|
||||||
for(tmap::const_iterator m = tmp.begin(); m != tmp.end(); ++m)
|
for(tmap::const_iterator m = tmp.begin(); m != tmp.end(); ++m)
|
||||||
(*m_context_weights)[m->first] = xmlrpc_c::value_double(m->second);
|
(*m_context_weights)[m->first] = xmlrpc_c::value_double(m->second);
|
||||||
}
|
}
|
||||||
return m_context_weights;
|
return m_context_weights;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,7 +30,7 @@ GetContextWindow() const
|
|||||||
return m_context;
|
return m_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPTR<std::map<std::string, float> const>
|
SPTR<std::map<std::string, float> const>
|
||||||
TranslationTask::GetContextWeights() const
|
TranslationTask::GetContextWeights() const
|
||||||
{
|
{
|
||||||
return m_context_weights;
|
return m_context_weights;
|
||||||
|
Loading…
Reference in New Issue
Block a user