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
path: root/moses/FF
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2015-10-13 19:50:35 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-10-13 19:50:35 +0300
commit1a93fae9ac2950ef5da8698b4576ac11e9ba21cf (patch)
treeb5e59ddbb8d0108a356dfb8363902f7769ce120f /moses/FF
parented4ea135614dda708207f9741e2e372a43b55113 (diff)
TargetNgramState debugging
Diffstat (limited to 'moses/FF')
-rw-r--r--moses/FF/TargetNgramFeature.cpp3
-rw-r--r--moses/FF/TargetNgramFeature.h4
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;
}