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>2013-09-10 17:36:21 +0400
committerHieu Hoang <hieuhoang@gmail.com>2013-09-10 17:36:21 +0400
commitf379e5cb8a1d7e04072b4931b4f852b9a8ceb979 (patch)
tree483cd36ec820b3ce66d2b5f9db1a65c2a6bf9943 /moses/ScoreComponentCollection.h
parent52bb3bdf5aeaadba612a350d525201e55b6bf368 (diff)
lattice decoding with sparse features
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r--moses/ScoreComponentCollection.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/moses/ScoreComponentCollection.h b/moses/ScoreComponentCollection.h
index 5eb353981..6501242ec 100644
--- a/moses/ScoreComponentCollection.h
+++ b/moses/ScoreComponentCollection.h
@@ -46,6 +46,8 @@ namespace Moses
*/
struct ScorePair
{
+ friend std::ostream& operator<<(std::ostream& os, const ScorePair& rhs);
+
std::vector<float> denseScores;
std::map<StringPiece, float> sparseScores;
@@ -262,13 +264,7 @@ public:
m_scores[fname] += score;
}
- void Assign(const FeatureFunction* sp, const std::vector<float>& scores) {
- IndexPair indexes = GetIndexes(sp);
- CHECK(scores.size() == indexes.second - indexes.first);
- for (size_t i = 0; i < scores.size(); ++i) {
- m_scores[i + indexes.first] = scores[i];
- }
- }
+ void Assign(const FeatureFunction* sp, const std::vector<float>& scores);
//! Special version Assign(ScoreProducer, vector<float>)
//! to add the score from a single ScoreProducer that produces