diff options
author | Ulrich Germann <ulrich.germann@gmail.com> | 2015-04-26 04:12:16 +0300 |
---|---|---|
committer | Ulrich Germann <ulrich.germann@gmail.com> | 2015-04-26 04:12:16 +0300 |
commit | 0d72cdd72ceed04a2f611130124b1cd84bce0a02 (patch) | |
tree | 5fb86d85a4d8937d6c1564002e78fd8db9e6d78d /moses/Manager.cpp | |
parent | d773717ca0dc9c13db7755b9c3e57bbb9fe5f7a5 (diff) | |
parent | 10bd94212716859f028c08f988649062679c6250 (diff) |
Merge branch 'master' of https://github.com/moses-smt/mosesdecoder into mmt-dev
Conflicts:
moses/Syntax/F2S/Manager-inl.h
moses/TranslationModel/UG/mmsapt.cpp
Diffstat (limited to 'moses/Manager.cpp')
-rw-r--r-- | moses/Manager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/moses/Manager.cpp b/moses/Manager.cpp index cb91a9d29..a936fa7c7 100644 --- a/moses/Manager.cpp +++ b/moses/Manager.cpp @@ -55,6 +55,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #endif #include "util/exception.hh" +#include "util/random.hh" using namespace std; @@ -426,7 +427,7 @@ void Manager::CalcLatticeSamples(size_t count, TrellisPathList &ret) const //cerr << endl; //draw the sample - float frandom = log((float)rand()/RAND_MAX); + const float frandom = log(util::rand_incl(0.0f, 1.0f)); size_t position = 1; float sum = candidateScores[0]; for (; position < candidateScores.size() && sum < frandom; ++position) { @@ -1645,7 +1646,7 @@ void Manager::OutputNBest(std::ostream& out out << " |||"; // print scores with feature names - path.GetScoreBreakdown().OutputAllFeatureScores(out ); + path.GetScoreBreakdown()->OutputAllFeatureScores(out); // total out << " ||| " << path.GetTotalScore(); |