diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-02 22:12:39 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-16 22:03:22 +0300 |
commit | cfb1ab34c7d3178e4264d5bba876ddef6125e18f (patch) | |
tree | 790d5bd02c9d0415ddfbfedec2c1b73aaf3a6fd6 /moses/Phrase.cpp | |
parent | 786258cb288e0711a2614bfd36d5ec83353ab5c2 (diff) |
use util::StringStream
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r-- | moses/Phrase.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/moses/Phrase.cpp b/moses/Phrase.cpp index 7a9e847ba..f7400515a 100644 --- a/moses/Phrase.cpp +++ b/moses/Phrase.cpp @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "StaticData.h" // GetMaxNumFactors #include "util/string_piece.hh" +#include "util/string_stream.hh" #include "util/tokenize_piece.hh" using namespace std; @@ -117,7 +118,8 @@ std::string Phrase::GetStringRep(const vector<FactorType> factorsToPrint) const { bool markUnknown = StaticData::Instance().GetMarkUnknown(); - stringstream strme; + string str; + util::StringStream strme(str); for (size_t pos = 0 ; pos < GetSize() ; pos++) { if (markUnknown && GetWord(pos).IsOOV()) { strme << StaticData::Instance().GetUnknownWordPrefix(); @@ -128,7 +130,7 @@ std::string Phrase::GetStringRep(const vector<FactorType> factorsToPrint) const } } - return strme.str(); + return str; } Word &Phrase::AddWord() |