diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-13 19:50:35 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-13 19:50:35 +0300 |
commit | 1a93fae9ac2950ef5da8698b4576ac11e9ba21cf (patch) | |
tree | b5e59ddbb8d0108a356dfb8363902f7769ce120f /moses/FF | |
parent | ed4ea135614dda708207f9741e2e372a43b55113 (diff) |
TargetNgramState debugging
Diffstat (limited to 'moses/FF')
-rw-r--r-- | moses/FF/TargetNgramFeature.cpp | 3 | ||||
-rw-r--r-- | moses/FF/TargetNgramFeature.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/moses/FF/TargetNgramFeature.cpp b/moses/FF/TargetNgramFeature.cpp index b74af4694..744c6604a 100644 --- a/moses/FF/TargetNgramFeature.cpp +++ b/moses/FF/TargetNgramFeature.cpp @@ -42,6 +42,7 @@ size_t TargetNgramState::hash() const std::size_t ret = boost::hash_range(m_words.begin(), m_words.end()); return ret; } + bool TargetNgramState::operator==(const FFState& other) const { const TargetNgramState& rhs = dynamic_cast<const TargetNgramState&>(other); @@ -207,7 +208,7 @@ FFState* TargetNgramFeature::EvaluateWhenApplied(const Hypothesis& cur_hypo, accumulator->PlusEquals(this, last_ngram.str(), 1); } } - return NULL; + return new TargetNgramState(); } // prepare new state diff --git a/moses/FF/TargetNgramFeature.h b/moses/FF/TargetNgramFeature.h index 86e3b5d66..dd6c9a45f 100644 --- a/moses/FF/TargetNgramFeature.h +++ b/moses/FF/TargetNgramFeature.h @@ -19,7 +19,9 @@ namespace Moses class TargetNgramState : public FFState { public: - TargetNgramState(std::vector<Word> &words): m_words(words) {} + TargetNgramState() {} + + TargetNgramState(const std::vector<Word> &words): m_words(words) {} const std::vector<Word> GetWords() const { return m_words; } |