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
path: root/moses/PP
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2014-06-19 22:23:33 +0400
committerHieu Hoang <hieu@hoang.co.uk>2014-06-19 22:23:33 +0400
commitc460330430baf816e668a4ed5ad1f9f01dab9796 (patch)
treed9de7442f5b12375ff13a654c21e2bf2347c197f /moses/PP
parent137126ca5453ef67f0c934cc5e2d94eadb82e117 (diff)
debug output for PhraseProperty
Diffstat (limited to 'moses/PP')
-rw-r--r--moses/PP/CountsPhraseProperty.cpp9
-rw-r--r--moses/PP/CountsPhraseProperty.h2
-rw-r--r--moses/PP/PhraseProperty.cpp13
-rw-r--r--moses/PP/PhraseProperty.h2
4 files changed, 26 insertions, 0 deletions
diff --git a/moses/PP/CountsPhraseProperty.cpp b/moses/PP/CountsPhraseProperty.cpp
index def07e5da..b64366733 100644
--- a/moses/PP/CountsPhraseProperty.cpp
+++ b/moses/PP/CountsPhraseProperty.cpp
@@ -25,5 +25,14 @@ void CountsPhraseProperty::ProcessValue(const std::string &value)
assert( m_jointCount > 0 );
};
+std::ostream& operator<<(std::ostream &out, const CountsPhraseProperty &obj)
+{
+ out << "Count property="
+ << obj.GetTargetMarginal() << " "
+ << obj.GetSourceMarginal() << " "
+ << obj.GetJointCount();
+ return out;
+}
+
} // namespace Moses
diff --git a/moses/PP/CountsPhraseProperty.h b/moses/PP/CountsPhraseProperty.h
index 19382fe29..4f6fbcfa8 100644
--- a/moses/PP/CountsPhraseProperty.h
+++ b/moses/PP/CountsPhraseProperty.h
@@ -27,6 +27,8 @@ namespace Moses
class CountsPhraseProperty : public PhraseProperty
{
+ friend std::ostream& operator<<(std::ostream &, const CountsPhraseProperty &);
+
public:
CountsPhraseProperty() {};
diff --git a/moses/PP/PhraseProperty.cpp b/moses/PP/PhraseProperty.cpp
new file mode 100644
index 000000000..614b39c60
--- /dev/null
+++ b/moses/PP/PhraseProperty.cpp
@@ -0,0 +1,13 @@
+#include "PhraseProperty.h"
+
+namespace Moses
+{
+
+std::ostream& operator<<(std::ostream &out, const PhraseProperty &obj)
+{
+ out << "Base phrase property";
+ return out;
+}
+
+}
+
diff --git a/moses/PP/PhraseProperty.h b/moses/PP/PhraseProperty.h
index 3835ea33d..b7437369b 100644
--- a/moses/PP/PhraseProperty.h
+++ b/moses/PP/PhraseProperty.h
@@ -10,6 +10,8 @@ namespace Moses
*/
class PhraseProperty
{
+ friend std::ostream& operator<<(std::ostream &, const PhraseProperty &);
+
public:
PhraseProperty() : m_value(NULL) {};
~PhraseProperty() { if ( m_value != NULL ) delete m_value; };