diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2014-04-08 15:41:30 +0400 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2014-04-08 15:41:30 +0400 |
commit | f82e79d237487a38dcbbd2ed5f28e78acd2f3769 (patch) | |
tree | ede23a19c600e7d6ab1ffaccd1b333c693b36ae0 /moses/ConfusionNet.cpp | |
parent | 872facd17160cb409f45dc2a94c7ef85b0db60c0 (diff) |
Replaced calls to String2Word by calls to Word::CreateFromString(). String2Word is deprecated (code duplication) and should be removed.
Diffstat (limited to 'moses/ConfusionNet.cpp')
-rw-r--r-- | moses/ConfusionNet.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/moses/ConfusionNet.cpp b/moses/ConfusionNet.cpp index 48a03b9e7..1545b681b 100644 --- a/moses/ConfusionNet.cpp +++ b/moses/ConfusionNet.cpp @@ -120,7 +120,9 @@ namespace Moses return rv; } - +#if 0 + // Deprecated due to code duplication; + // use Word::CreateFromString() instead void ConfusionNet:: String2Word(const std::string& s,Word& w, @@ -132,6 +134,7 @@ namespace Moses FactorCollection::Instance().AddFactor (Input,factorOrder[i], factorStrVector[i])); } +#endif bool ConfusionNet:: @@ -155,7 +158,8 @@ namespace Moses Column col; while(is>>word) { Word w; - String2Word(word,w,factorOrder); + // String2Word(word,w,factorOrder); + w.CreateFromString(Input,factorOrder,StringPiece(word),false); std::vector<float> probs(totalCount, 0.0); for(size_t i=0; i < numInputScores; i++) { double prob; @@ -216,7 +220,9 @@ namespace Moses VERBOSE(1, "WARN: neg costs: "<<data[i][j].second.denseScores[0]<<" -> set to 0\n"); data[i][j].second.denseScores[0]=0.0; } - String2Word(word,data[i][j].first,factorOrder); + // String2Word(word,data[i][j].first,factorOrder); + Word& w = data[i][j].first; + w.CreateFromString(Input,factorOrder,StringPiece(word),false); } else return 0; } return !data.empty(); |