diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-03 02:33:38 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-16 22:03:22 +0300 |
commit | b6231e8c73dee466f87f28c6d7afb34d51866169 (patch) | |
tree | a5f908bcf37e8e823698da018b2b3059ed453f75 /moses/TranslationAnalysis.cpp | |
parent | dcea021cd7c6b1669a26d0808775c267972d595a (diff) |
make util::StringStream more like std::stringstream
Diffstat (limited to 'moses/TranslationAnalysis.cpp')
-rw-r--r-- | moses/TranslationAnalysis.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/moses/TranslationAnalysis.cpp b/moses/TranslationAnalysis.cpp index e01bc71e5..ebca957ce 100644 --- a/moses/TranslationAnalysis.cpp +++ b/moses/TranslationAnalysis.cpp @@ -41,11 +41,9 @@ void PrintTranslationAnalysis(std::ostream &os, const Hypothesis* hypo) if (doLMStats) lmAcc.resize((*tpi)->GetLMStats()->size(), 0); for (; tpi != translationPath.end(); ++tpi) { - std::string smsStr; - util::StringStream sms(smsStr); + util::StringStream sms; - std::string tmsStr; - util::StringStream tms(tmsStr); + util::StringStream tms; std::string target = (*tpi)->GetTargetPhraseStringRep(); std::string source = (*tpi)->GetSourcePhraseStringRep(); WordsRange twr = (*tpi)->GetCurrTargetWordsRange(); @@ -93,8 +91,8 @@ void PrintTranslationAnalysis(std::ostream &os, const Hypothesis* hypo) for (; swr_i <= swr.GetEndPos() && swr.GetEndPos() != NOT_FOUND; swr_i++) { tms << '-' << swr_i; } - if (!epsilon) targetMap.push_back(smsStr); - sourceMap.push_back(tmsStr); + if (!epsilon) targetMap.push_back(sms.str()); + sourceMap.push_back(tms.str()); } std::vector<std::string>::iterator si = sourceMap.begin(); std::vector<std::string>::iterator ti = targetMap.begin(); |