00001 #pragma once
00002
00003 #include "moses/PP/PhraseProperty.h"
00004 #include <string>
00005
00006 #include <boost/shared_ptr.hpp>
00007 #include <boost/unordered_map.hpp>
00008
00009 namespace Moses
00010 {
00011
00012 class PhrasePropertyCreator;
00013
00014 class PhrasePropertyFactory
00015 {
00016 public:
00017 PhrasePropertyFactory();
00018
00019 ~PhrasePropertyFactory();
00020
00021 boost::shared_ptr<PhraseProperty> ProduceProperty(const std::string &key, const std::string &value) const;
00022 void PrintPP() const;
00023
00024 private:
00025 void Add(const std::string &name, PhrasePropertyCreator *creator);
00026
00027 typedef boost::unordered_map<std::string, boost::shared_ptr<PhrasePropertyCreator> > Registry;
00028
00029 Registry m_registry;
00030 };
00031
00032 }
00033