2014-05-20 00:54:08 +04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
|
|
|
/** base class for all phrase properties.
|
|
|
|
*/
|
|
|
|
class PhraseProperty
|
|
|
|
{
|
2014-06-19 22:23:33 +04:00
|
|
|
friend std::ostream& operator<<(std::ostream &, const PhraseProperty &);
|
|
|
|
|
2014-05-20 00:54:08 +04:00
|
|
|
public:
|
2014-06-13 21:01:41 +04:00
|
|
|
PhraseProperty() : m_value(NULL) {};
|
2015-01-14 14:07:42 +03:00
|
|
|
virtual ~PhraseProperty() {
|
|
|
|
if ( m_value != NULL ) delete m_value;
|
|
|
|
};
|
2014-05-20 00:54:08 +04:00
|
|
|
|
2015-01-14 14:07:42 +03:00
|
|
|
virtual void ProcessValue(const std::string &value) {
|
|
|
|
m_value = new std::string(value);
|
|
|
|
};
|
2014-05-20 00:54:08 +04:00
|
|
|
|
2015-01-14 14:07:42 +03:00
|
|
|
virtual const std::string *GetValueString() const {
|
|
|
|
return m_value;
|
|
|
|
};
|
2014-05-20 00:54:08 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2016-02-12 20:46:57 +03:00
|
|
|
virtual void Print(std::ostream& out) const;
|
|
|
|
|
2015-01-14 14:07:42 +03:00
|
|
|
std::string *m_value;
|
2014-05-20 00:54:08 +04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Moses
|
|
|
|
|