diff options
author | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-04-10 18:48:38 +0400 |
---|---|---|
committer | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-04-10 18:48:38 +0400 |
commit | e9a70a1ce0414a205d3c50706a9db38981846c2e (patch) | |
tree | 599698d803d42936e59b50353bba73af0dbf6515 /moses | |
parent | bed22776edd38a0d6d512f105e46e71608d4a0b7 (diff) |
fix function signature
Diffstat (limited to 'moses')
-rw-r--r-- | moses/src/TargetWordInsertionFeature.cpp | 2 | ||||
-rw-r--r-- | moses/src/TargetWordInsertionFeature.h | 2 | ||||
-rw-r--r-- | moses/src/WordTranslationFeature.cpp | 24 |
3 files changed, 14 insertions, 14 deletions
diff --git a/moses/src/TargetWordInsertionFeature.cpp b/moses/src/TargetWordInsertionFeature.cpp index 0d39cc42f..620204464 100644 --- a/moses/src/TargetWordInsertionFeature.cpp +++ b/moses/src/TargetWordInsertionFeature.cpp @@ -30,7 +30,7 @@ bool TargetWordInsertionFeature::Load(const std::string &filePath) return true; } -void TargetWordInsertionFeature::Evaluate(const ChartHypothesis& cur_hypo, +void TargetWordInsertionFeature::Evaluate(const Hypothesis& cur_hypo, ScoreComponentCollection* accumulator) const { const TargetPhrase& targetPhrase = cur_hypo.GetCurrTargetPhrase(); diff --git a/moses/src/TargetWordInsertionFeature.h b/moses/src/TargetWordInsertionFeature.h index 427ed1cad..fd5bd30a8 100644 --- a/moses/src/TargetWordInsertionFeature.h +++ b/moses/src/TargetWordInsertionFeature.h @@ -26,7 +26,7 @@ public: {} bool Load(const std::string &filePath); - void Evaluate(const ChartHypothesis& cur_hypo, + void Evaluate(const Hypothesis& cur_hypo, ScoreComponentCollection* accumulator) const; void EvaluateChart( diff --git a/moses/src/WordTranslationFeature.cpp b/moses/src/WordTranslationFeature.cpp index 3e62c1724..32c8f9291 100644 --- a/moses/src/WordTranslationFeature.cpp +++ b/moses/src/WordTranslationFeature.cpp @@ -53,8 +53,8 @@ void WordTranslationFeature::InitializeForInput( Sentence const& in ) void WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, ScoreComponentCollection* accumulator) const { - const Sentence& input = *(m_local->input); - const TargetPhrase& targetPhrase = cur_hypo.GetCurrTargetPhrase(); + const Sentence& input = *(m_local->input); + const TargetPhrase& targetPhrase = cur_hypo.GetCurrTargetPhrase(); const AlignmentInfo &alignment = targetPhrase.GetAlignmentInfo(); // process aligned words @@ -192,19 +192,19 @@ void WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, ScoreComponent void WordTranslationFeature::EvaluateChart(const ChartHypothesis& cur_hypo, int featureID, ScoreComponentCollection* accumulator) const { - const Sentence& input = *(m_local->input); - const TargetPhrase& targetPhrase = cur_hypo.GetCurrTargetPhrase(); + const Sentence& input = *(m_local->input); + const TargetPhrase& targetPhrase = cur_hypo.GetCurrTargetPhrase(); const AlignmentInfo &alignment = targetPhrase.GetAlignmentInfo(); // process aligned words for (AlignmentInfo::const_iterator alignmentPoint = alignment.begin(); alignmentPoint != alignment.end(); alignmentPoint++) { - const Phrase& sourcePhrase = targetPhrase.GetSourcePhrase(); - int sourceIndex = alignmentPoint->first; - int targetIndex = alignmentPoint->second; - Word ws = sourcePhrase.GetWord(sourceIndex); - if (m_factorTypeSource == 0 && ws.IsNonTerminal()) continue; - Word wt = targetPhrase.GetWord(targetIndex); - if (m_factorTypeSource == 0 && wt.IsNonTerminal()) continue; + const Phrase& sourcePhrase = targetPhrase.GetSourcePhrase(); + int sourceIndex = alignmentPoint->first; + int targetIndex = alignmentPoint->second; + Word ws = sourcePhrase.GetWord(sourceIndex); + if (m_factorTypeSource == 0 && ws.IsNonTerminal()) continue; + Word wt = targetPhrase.GetWord(targetIndex); + if (m_factorTypeSource == 0 && wt.IsNonTerminal()) continue; string sourceWord = ws.GetFactor(m_factorTypeSource)->GetString(); string targetWord = wt.GetFactor(m_factorTypeTarget)->GetString(); if (m_ignorePunctuation) { @@ -225,7 +225,7 @@ void WordTranslationFeature::EvaluateChart(const ChartHypothesis& cur_hypo, int if (m_vocabTarget.find(targetWord) == m_vocabTarget.end()) targetWord = "OTHER"; } - + if (m_simple) { // construct feature name stringstream featureName; |