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