|
|
|
#pragma once |
|
|
|
#include "moses/PP/PhraseProperty.h" |
|
#include "util/exception.hh" |
|
#include <string> |
|
#include <list> |
|
|
|
namespace Moses |
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CountsPhraseProperty : public PhraseProperty |
|
{ |
|
friend std::ostream& operator<<(std::ostream &, const CountsPhraseProperty &); |
|
|
|
public: |
|
|
|
CountsPhraseProperty() {}; |
|
|
|
virtual void ProcessValue(const std::string &value); |
|
|
|
size_t GetSourceMarginal() const { |
|
return m_sourceMarginal; |
|
} |
|
|
|
size_t GetTargetMarginal() const { |
|
return m_targetMarginal; |
|
} |
|
|
|
float GetJointCount() const { |
|
return m_jointCount; |
|
} |
|
|
|
virtual const std::string *GetValueString() const { |
|
UTIL_THROW2("CountsPhraseProperty: value string not available in this phrase property"); |
|
return NULL; |
|
}; |
|
|
|
protected: |
|
|
|
float m_sourceMarginal, m_targetMarginal, m_jointCount; |
|
|
|
}; |
|
|
|
} |
|
|
|
|