mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 04:43:03 +03:00
Fix incorrect integer concatenation in error messages
This commit is contained in:
parent
f5b872b66d
commit
52eced7572
@ -12,6 +12,7 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "FeatureArray.h"
|
||||
|
||||
namespace MosesTuning
|
||||
@ -103,7 +104,7 @@ public:
|
||||
inline int getName(std::size_t idx) const {
|
||||
idx2name::const_iterator i = m_index_to_array_name.find(idx);
|
||||
if (i != m_index_to_array_name.end())
|
||||
throw std::runtime_error("there is no entry at index " + idx);
|
||||
throw std::runtime_error("there is no entry at index " + boost::lexical_cast<std::string>(idx));
|
||||
return i->second;
|
||||
}
|
||||
|
||||
@ -116,7 +117,7 @@ public:
|
||||
throw std::runtime_error("Error: you required an too big index");
|
||||
std::map<std::size_t, std::string>::const_iterator it = m_index_to_feature_name.find(idx);
|
||||
if (it == m_index_to_feature_name.end()) {
|
||||
throw std::runtime_error("Error: specified id is unknown: " + idx);
|
||||
throw std::runtime_error("Error: specified id is unknown: " + boost::lexical_cast<std::string>(idx));
|
||||
} else {
|
||||
return it->second;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "ScoreArray.h"
|
||||
#include "ScoreStats.h"
|
||||
|
||||
@ -108,7 +109,7 @@ public:
|
||||
inline int getName(std::size_t idx) const {
|
||||
idx2name::const_iterator i = m_index_to_array_name.find(idx);
|
||||
if (i != m_index_to_array_name.end())
|
||||
throw std::runtime_error("there is no entry at index " + idx);
|
||||
throw std::runtime_error("there is no entry at index " + boost::lexical_cast<std::string>(idx));
|
||||
return i->second;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user