mosesdecoder/moses/TranslationModel/PhraseDictionaryDynSuffixArray.h
2012-11-27 16:31:42 +00:00

48 lines
1.5 KiB
C++

#ifndef moses_PhraseDictionaryDynSuffixArray_h
#define moses_PhraseDictionaryDynSuffixArray_h
#include <map>
#include "moses/TranslationModel/PhraseDictionary.h"
#include "moses/TranslationModel/BilingualDynSuffixArray.h"
namespace Moses
{
/** Implementation of a phrase table using the biconcor suffix array.
* Wrapper around a BilingualDynSuffixArray object
*/
class PhraseDictionaryDynSuffixArray: public PhraseDictionary
{
public:
PhraseDictionaryDynSuffixArray(size_t m_numScoreComponent, PhraseDictionaryFeature* feature);
~PhraseDictionaryDynSuffixArray();
bool Load( const std::vector<FactorType>& m_input
, const std::vector<FactorType>& m_output
, std::string m_source
, std::string m_target
, std::string m_alignments
, const std::vector<float> &m_weight
, size_t m_tableLimit
, const LMList &languageModels
, float weightWP);
// functions below required by base class
const TargetPhraseCollection* GetTargetPhraseCollection(const Phrase& src) const;
void InitializeForInput(const InputType& i);
void CleanUp(const InputType &source);
void insertSnt(string&, string&, string&);
void deleteSnt(unsigned, unsigned);
ChartRuleLookupManager *CreateRuleLookupManager(const InputType&, const ChartCellCollectionBase&);
private:
BilingualDynSuffixArray *m_biSA;
std::vector<float> m_weight;
size_t m_tableLimit;
const LMList *m_languageModels;
float m_weightWP;
};
} // end namespace
#endif