00001
00002
00003 #ifndef moses_PhraseDictionaryTreeAdaptor_h
00004 #define moses_PhraseDictionaryTreeAdaptor_h
00005
00006 #include <vector>
00007 #include "util/check.hh"
00008 #include "TypeDef.h"
00009 #include "PhraseDictionaryMemory.h"
00010 #include "TargetPhraseCollection.h"
00011
00012 namespace Moses
00013 {
00014
00015 class Phrase;
00016 class PDTAimp;
00017 class WordsRange;
00018 class InputType;
00019
00020
00021
00022
00023 class PhraseDictionaryTreeAdaptor : public PhraseDictionary
00024 {
00025 typedef PhraseDictionary MyBase;
00026 PDTAimp *imp;
00027 friend class PDTAimp;
00028 PhraseDictionaryTreeAdaptor();
00029 PhraseDictionaryTreeAdaptor(const PhraseDictionaryTreeAdaptor&);
00030 void operator=(const PhraseDictionaryTreeAdaptor&);
00031
00032 public:
00033 PhraseDictionaryTreeAdaptor(size_t numScoreComponent, unsigned numInputScores, const PhraseDictionaryFeature* feature);
00034 virtual ~PhraseDictionaryTreeAdaptor();
00035
00036
00037
00038
00039
00040
00041
00042 void EnableCache();
00043 void DisableCache();
00044
00045
00046 bool Load(const std::vector<FactorType> &input
00047 , const std::vector<FactorType> &output
00048 , const std::string &filePath
00049 , const std::vector<float> &weight
00050 , size_t tableLimit
00051 , const LMList &languageModels
00052 , float weightWP);
00053
00054
00055
00056 TargetPhraseCollection const* GetTargetPhraseCollection(Phrase const &src) const;
00057 TargetPhraseCollection const* GetTargetPhraseCollection(InputType const& src,WordsRange const & srcRange) const;
00058
00059 std::string GetScoreProducerDescription(unsigned idx=0) const;
00060 std::string GetScoreProducerWeightShortName(unsigned idx=0) const;
00061
00062 size_t GetNumInputScores() const;
00063 virtual void InitializeForInput(InputType const& source);
00064
00065 virtual ChartRuleLookupManager *CreateRuleLookupManager(
00066 const InputType &,
00067 const ChartCellCollection &) {
00068 CHECK(false);
00069 return 0;
00070 }
00071 };
00072
00073 }
00074 #endif