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
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2013-05-08 14:28:31 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-05-08 14:28:31 +0400
commita1b2f66d91a3bb2122674f727e257ed256d9f729 (patch)
tree3444c8d7670ead653bec883eeac5efeb7692fc62 /moses/PartialTranslOptColl.cpp
parent8a371f65474ca8c242bbee833579a77a306ec153 (diff)
each new target phrase in factored decomposition holds scores from previous steps.
Diffstat (limited to 'moses/PartialTranslOptColl.cpp')
-rw-r--r--moses/PartialTranslOptColl.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/moses/PartialTranslOptColl.cpp b/moses/PartialTranslOptColl.cpp
index 91ad65415..aacee75ed 100644
--- a/moses/PartialTranslOptColl.cpp
+++ b/moses/PartialTranslOptColl.cpp
@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "PartialTranslOptColl.h"
#include <algorithm>
+#include <iostream>
+
+using namespace std;
namespace Moses
{
@@ -37,7 +40,6 @@ PartialTranslOptColl::PartialTranslOptColl()
/** add a partial translation option to the collection (without pruning) */
void PartialTranslOptColl::AddNoPrune(const TranslationSystem* system, TranslationOption *partialTranslOpt)
{
- partialTranslOpt->CalcScore(system);
if (partialTranslOpt->GetFutureScore() >= m_worstScore) {
m_list.push_back(partialTranslOpt);
if (partialTranslOpt->GetFutureScore() > m_bestScore)
@@ -95,6 +97,16 @@ void PartialTranslOptColl::Prune()
// TRACE_ERR( "pruned to size " << m_list.size() << ", total pruned: " << m_totalPruned << std::endl);
}
+// friend
+ostream& operator<<(ostream& out, const PartialTranslOptColl& possibleTranslation)
+{
+ for (size_t i = 0; i < possibleTranslation.m_list.size(); ++i) {
+ const TranslationOption &transOpt = *possibleTranslation.m_list[i];
+ out << transOpt << endl;
+ }
+ return out;
+}
+
}