Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-10-03 02:33:38 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-16 22:03:22 +0300
commitb6231e8c73dee466f87f28c6d7afb34d51866169 (patch)
treea5f908bcf37e8e823698da018b2b3059ed453f75 /moses/Parameter.cpp
parentdcea021cd7c6b1669a26d0808775c267972d595a (diff)
make util::StringStream more like std::stringstream
Diffstat (limited to 'moses/Parameter.cpp')
-rw-r--r--moses/Parameter.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/moses/Parameter.cpp b/moses/Parameter.cpp
index eb79f1452..f6058cbd8 100644
--- a/moses/Parameter.cpp
+++ b/moses/Parameter.cpp
@@ -702,8 +702,7 @@ ConvertWeightArgsPhraseModel(const string &oldWeightName)
size_t currOldInd = 0;
for(size_t currDict = 0 ; currDict < translationVector.size(); currDict++) {
- string ptLineStr;
- util::StringStream ptLine(ptLineStr);
+ util::StringStream ptLine;
vector<string> token = Tokenize(translationVector[currDict]);
@@ -799,7 +798,7 @@ ConvertWeightArgsPhraseModel(const string &oldWeightName)
ptLine << "alignment-path=" << token[6] << " ";
}
- AddFeature(ptLineStr);
+ AddFeature(ptLine.str());
} // for(size_t currDict = 0 ; currDict < translationVector.size(); currDict++) {
} // if (GetParam("ttable-file").size() > 0) {
@@ -862,8 +861,7 @@ ConvertWeightArgsDistortion()
}
SetWeight("LexicalReordering", indTable, weights);
- string str;
- util::StringStream strme(str);
+ util::StringStream strme;
strme << "LexicalReordering "
<< "type=" << toks[1] << " ";
@@ -877,7 +875,7 @@ ConvertWeightArgsDistortion()
strme << "num-features=" << toks[2] << " ";
strme << "path=" << toks[3];
- AddFeature(str);
+ AddFeature(strme.str());
}
}
@@ -1010,14 +1008,13 @@ ConvertWeightArgsGeneration(const std::string &oldWeightName, const std::string
}
SetWeight(newWeightName, indTable, weights);
- string str;
- util::StringStream strme(str);
+ util::StringStream strme;
strme << "Generation "
<< "input-factor=" << modelToks[0] << " "
<< "output-factor=" << modelToks[1] << " "
<< "num-features=" << modelToks[2] << " "
<< "path=" << modelToks[3];
- AddFeature(str);
+ AddFeature(strme.str());
}
}