diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-13 15:16:55 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-13 15:16:55 +0400 |
commit | 0d60b7f2ddcfd4be0a74e112eba7d2a2b96dee58 (patch) | |
tree | d18f5d34af9c30e3e226cdb8bcabea6d21cf1a0e | |
parent | f6761003285ef52c4c21ddc9a2650f42ea867212 (diff) |
implement Evaluate(inputpath, input) for chart translation options. Plumbing for lattice input
-rw-r--r-- | moses/ChartParserCallback.h | 2 | ||||
-rw-r--r-- | moses/ChartTranslationOption.cpp | 2 | ||||
-rw-r--r-- | moses/ChartTranslationOption.h | 2 | ||||
-rw-r--r-- | moses/ChartTranslationOptionList.cpp | 4 | ||||
-rw-r--r-- | moses/ChartTranslationOptionList.h | 2 | ||||
-rw-r--r-- | moses/ChartTranslationOptions.cpp | 4 | ||||
-rw-r--r-- | moses/ChartTranslationOptions.h | 2 | ||||
-rw-r--r-- | moses/Incremental.cpp | 2 |
8 files changed, 10 insertions, 10 deletions
diff --git a/moses/ChartParserCallback.h b/moses/ChartParserCallback.h index b68346c5f..25953ff9c 100644 --- a/moses/ChartParserCallback.h +++ b/moses/ChartParserCallback.h @@ -24,7 +24,7 @@ public: virtual void AddPhraseOOV(TargetPhrase &phrase, std::list<TargetPhraseCollection*> &waste_memory, const WordsRange &range) = 0; - virtual void Evaluate(const InputPath &inputPath, const InputType &input) = 0; + virtual void Evaluate(const InputType &input, const InputPath &inputPath) = 0; }; } // namespace Moses diff --git a/moses/ChartTranslationOption.cpp b/moses/ChartTranslationOption.cpp index 74b8fb80b..32edaf796 100644 --- a/moses/ChartTranslationOption.cpp +++ b/moses/ChartTranslationOption.cpp @@ -10,7 +10,7 @@ ChartTranslationOption::ChartTranslationOption(const TargetPhrase &targetPhrase) { } -void ChartTranslationOption::Evaluate(const InputPath &inputPath, const InputType &input) +void ChartTranslationOption::Evaluate(const InputType &input, const InputPath &inputPath) { const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions(); diff --git a/moses/ChartTranslationOption.h b/moses/ChartTranslationOption.h index 46e59e84d..8984adf66 100644 --- a/moses/ChartTranslationOption.h +++ b/moses/ChartTranslationOption.h @@ -25,7 +25,7 @@ public: return m_scoreBreakdown; } - void Evaluate(const InputPath &inputPath, const InputType &input); + void Evaluate(const InputType &input, const InputPath &inputPath); }; } diff --git a/moses/ChartTranslationOptionList.cpp b/moses/ChartTranslationOptionList.cpp index 19b272d2a..1e8392d45 100644 --- a/moses/ChartTranslationOptionList.cpp +++ b/moses/ChartTranslationOptionList.cpp @@ -147,12 +147,12 @@ void ChartTranslationOptionList::ApplyThreshold() m_size = std::distance(m_collection.begin(), bound); } -void ChartTranslationOptionList::Evaluate(const InputPath &inputPath, const InputType &input) +void ChartTranslationOptionList::Evaluate(const InputType &input, const InputPath &inputPath) { CollType::iterator iter; for (iter = m_collection.begin(); iter != m_collection.end(); ++iter) { ChartTranslationOptions &transOpts = **iter; - transOpts.Evaluate(inputPath, input); + transOpts.Evaluate(input, inputPath); } } diff --git a/moses/ChartTranslationOptionList.h b/moses/ChartTranslationOptionList.h index 5f51f8d2e..6150fa14c 100644 --- a/moses/ChartTranslationOptionList.h +++ b/moses/ChartTranslationOptionList.h @@ -60,7 +60,7 @@ public: void Clear(); void ApplyThreshold(); - void Evaluate(const InputPath &inputPath, const InputType &input); + void Evaluate(const InputType &input, const InputPath &inputPath); private: typedef std::vector<ChartTranslationOptions*> CollType; diff --git a/moses/ChartTranslationOptions.cpp b/moses/ChartTranslationOptions.cpp index c63741115..121756818 100644 --- a/moses/ChartTranslationOptions.cpp +++ b/moses/ChartTranslationOptions.cpp @@ -64,12 +64,12 @@ float ChartTranslationOptions::CalcEstimateOfBestScore( return estimateOfBestScore; } -void ChartTranslationOptions::Evaluate(const InputPath &inputPath, const InputType &input) +void ChartTranslationOptions::Evaluate(const InputType &input, const InputPath &inputPath) { CollType::iterator iter; for (iter = m_collection.begin(); iter != m_collection.end(); ++iter) { ChartTranslationOption &transOpt = **iter; - transOpt.Evaluate(inputPath, input); + transOpt.Evaluate(input, inputPath); } } diff --git a/moses/ChartTranslationOptions.h b/moses/ChartTranslationOptions.h index b638d6cef..55def28b7 100644 --- a/moses/ChartTranslationOptions.h +++ b/moses/ChartTranslationOptions.h @@ -81,7 +81,7 @@ public: return m_estimateOfBestScore; } - void Evaluate(const InputPath &inputPath, const InputType &input); + void Evaluate(const InputType &input, const InputPath &inputPath); private: diff --git a/moses/Incremental.cpp b/moses/Incremental.cpp index 6a2e594eb..66fc06a33 100644 --- a/moses/Incremental.cpp +++ b/moses/Incremental.cpp @@ -97,7 +97,7 @@ public: return vertex.BestChild(); } - void Evaluate(const InputPath &inputPath, const InputType &input) + void Evaluate(const InputType &input, const InputPath &inputPath) { // TODO for input lattice } |