diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-11 13:12:54 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-11 16:52:48 +0300 |
commit | 65f4f1f92af3d645b1dfc2f161bbcf47bdce1402 (patch) | |
tree | d24edefd5cbe1e954021958b5214471c29c96a04 /moses/ChartTranslationOptionList.cpp | |
parent | 40ed3df9cb513681569a2fcde32a5215c38253f3 (diff) |
Code cleanup and refactoring.
Diffstat (limited to 'moses/ChartTranslationOptionList.cpp')
-rw-r--r-- | moses/ChartTranslationOptionList.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/moses/ChartTranslationOptionList.cpp b/moses/ChartTranslationOptionList.cpp index a878fdafd..c9f88e494 100644 --- a/moses/ChartTranslationOptionList.cpp +++ b/moses/ChartTranslationOptionList.cpp @@ -33,7 +33,8 @@ using namespace std; namespace Moses { -ChartTranslationOptionList::ChartTranslationOptionList(size_t ruleLimit, const InputType &input) +ChartTranslationOptionList:: +ChartTranslationOptionList(size_t ruleLimit, const InputType &input) : m_size(0) , m_ruleLimit(ruleLimit) { @@ -128,7 +129,7 @@ AddPhraseOOV(TargetPhrase &phrase, Add(*tpc, empty, range); } -void ChartTranslationOptionList::ApplyThreshold() +void ChartTranslationOptionList::ApplyThreshold(float const threshold) { if (m_ruleLimit && m_size > m_ruleLimit) { // Something's gone wrong if the list has grown to m_ruleLimit * 2 @@ -154,11 +155,11 @@ void ChartTranslationOptionList::ApplyThreshold() scoreThreshold = (score > scoreThreshold) ? score : scoreThreshold; } - scoreThreshold += StaticData::Instance().GetTranslationOptionThreshold(); + scoreThreshold += threshold; // StaticData::Instance().GetTranslationOptionThreshold(); CollType::iterator bound = std::partition(m_collection.begin(), - m_collection.begin()+m_size, - ScoreThresholdPred(scoreThreshold)); + m_collection.begin()+m_size, + ScoreThresholdPred(scoreThreshold)); m_size = std::distance(m_collection.begin(), bound); } |