From 644cac03f6e27400354a2b3ecb065e384427e07a Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 7 May 2013 11:40:03 +0100 Subject: [PATCH] eclipse --- .../other-builds/moses-chart-cmd/.cproject | 1 + contrib/other-builds/moses-cmd/.cproject | 2 + contrib/other-builds/moses/.project | 1932 ++++++++++++++++- contrib/other-builds/search/.cproject | 1 - moses/PartialTranslOptColl.cpp | 14 + moses/PartialTranslOptColl.h | 2 + 6 files changed, 1925 insertions(+), 27 deletions(-) diff --git a/contrib/other-builds/moses-chart-cmd/.cproject b/contrib/other-builds/moses-chart-cmd/.cproject index 71462b5df..c6dfa5ae1 100644 --- a/contrib/other-builds/moses-chart-cmd/.cproject +++ b/contrib/other-builds/moses-chart-cmd/.cproject @@ -75,6 +75,7 @@ + diff --git a/contrib/other-builds/moses-cmd/.cproject b/contrib/other-builds/moses-cmd/.cproject index 42d2100d8..84968fa1e 100644 --- a/contrib/other-builds/moses-cmd/.cproject +++ b/contrib/other-builds/moses-cmd/.cproject @@ -46,6 +46,7 @@ diff --git a/moses/PartialTranslOptColl.cpp b/moses/PartialTranslOptColl.cpp index 91ad65415..fdc52f365 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 +#include + +using namespace std; namespace Moses { @@ -95,6 +98,17 @@ 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; +} + + } diff --git a/moses/PartialTranslOptColl.h b/moses/PartialTranslOptColl.h index bbe4d05a1..8184bdfd5 100644 --- a/moses/PartialTranslOptColl.h +++ b/moses/PartialTranslOptColl.h @@ -43,6 +43,8 @@ namespace Moses */ class PartialTranslOptColl { + friend std::ostream& operator<<(std::ostream& out, const PartialTranslOptColl& possibleTranslation); + protected: std::vector m_list; float m_bestScore; /**< score of the best translation option */