mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-26 11:28:48 +03:00
34 lines
642 B
C
34 lines
642 B
C
|
#pragma once
|
||
|
|
||
|
#include "moses/PP/PhraseProperty.h"
|
||
|
#include <string>
|
||
|
|
||
|
#include <boost/shared_ptr.hpp>
|
||
|
#include <boost/unordered_map.hpp>
|
||
|
|
||
|
namespace Moses
|
||
|
{
|
||
|
|
||
|
class PhrasePropertyCreator;
|
||
|
|
||
|
class PhrasePropertyFactory
|
||
|
{
|
||
|
public:
|
||
|
PhrasePropertyFactory();
|
||
|
|
||
|
~PhrasePropertyFactory();
|
||
|
|
||
|
boost::shared_ptr<PhraseProperty> ProduceProperty(const std::string &key, const std::string &value) const;
|
||
|
void PrintPP() const;
|
||
|
|
||
|
private:
|
||
|
void Add(const std::string &name, PhrasePropertyCreator *creator);
|
||
|
|
||
|
typedef boost::unordered_map<std::string, boost::shared_ptr<PhrasePropertyCreator> > Registry;
|
||
|
|
||
|
Registry m_registry;
|
||
|
};
|
||
|
|
||
|
} // namespace Moses
|
||
|
|