/*********************************************************************** Moses - factored phrase-based language decoder Copyright (C) 2013- University of Edinburgh This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ #ifndef moses_PhraseDictionaryInterpolated_h #define moses_PhraseDictionaryInterpolated_h #include #include "moses/TranslationModel/PhraseDictionary.h" #include "moses/TranslationModel/PhraseDictionaryTreeAdaptor.h" namespace Moses { /** * An interpolation of 1 or more PhraseDictionaryTree translation tables. **/ class PhraseDictionaryInterpolated : public PhraseDictionary { public: PhraseDictionaryInterpolated (size_t numScoreComponent,size_t numInputScores,const PhraseDictionaryFeature* feature); virtual ~PhraseDictionaryInterpolated() { delete m_targetPhrases; } // initialize ... bool Load(const std::vector &input , const std::vector &output , const std::vector& config , const std::vector &weight , size_t tableLimit , const LMList &languageModels , float weightWP); virtual const TargetPhraseCollection *GetTargetPhraseCollection(const Phrase& src) const; virtual void InitializeForInput(InputType const& source); virtual ChartRuleLookupManager *CreateRuleLookupManager( const InputType &, const ChartCellCollectionBase &) { throw std::logic_error("PhraseDictionaryInterpolated.CreateRuleLookupManager() Not implemented"); } private: typedef boost::shared_ptr DictionaryHandle; std::vector m_dictionaries; std::vector > m_weights; //feature x table mutable TargetPhraseCollection* m_targetPhrases; std::vector m_weightT; size_t m_tableLimit; const LMList* m_languageModels; float m_weightWP; }; } #endif