2010-02-24 14:15:44 +03:00
|
|
|
#ifndef moses_PhraseDictionaryDynSuffixArray_h
|
|
|
|
#define moses_PhraseDictionaryDynSuffixArray_h
|
2010-02-12 14:05:43 +03:00
|
|
|
|
2010-04-07 15:02:04 +04:00
|
|
|
#include <map>
|
|
|
|
|
2012-11-27 19:08:31 +04:00
|
|
|
#include "moses/TranslationModel/PhraseDictionary.h"
|
2012-11-27 20:31:42 +04:00
|
|
|
#include "moses/TranslationModel/BilingualDynSuffixArray.h"
|
2010-02-12 14:05:43 +03:00
|
|
|
|
2011-02-24 16:14:42 +03:00
|
|
|
namespace Moses
|
|
|
|
{
|
2010-02-12 14:05:43 +03:00
|
|
|
|
2012-06-29 02:29:46 +04:00
|
|
|
/** Implementation of a phrase table using the biconcor suffix array.
|
|
|
|
* Wrapper around a BilingualDynSuffixArray object
|
|
|
|
*/
|
2011-02-24 16:14:42 +03:00
|
|
|
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);
|
2012-07-19 19:41:41 +04:00
|
|
|
void CleanUp(const InputType &source);
|
2010-05-07 13:50:19 +04:00
|
|
|
void insertSnt(string&, string&, string&);
|
|
|
|
void deleteSnt(unsigned, unsigned);
|
2012-10-11 17:27:30 +04:00
|
|
|
ChartRuleLookupManager *CreateRuleLookupManager(const InputType&, const ChartCellCollectionBase&);
|
2010-02-12 14:05:43 +03:00
|
|
|
private:
|
2011-02-24 16:14:42 +03:00
|
|
|
BilingualDynSuffixArray *m_biSA;
|
|
|
|
std::vector<float> m_weight;
|
|
|
|
size_t m_tableLimit;
|
|
|
|
const LMList *m_languageModels;
|
|
|
|
float m_weightWP;
|
|
|
|
|
2010-04-08 21:57:38 +04:00
|
|
|
|
2010-02-12 14:05:43 +03:00
|
|
|
};
|
2010-04-08 18:52:35 +04:00
|
|
|
|
2010-02-12 14:05:43 +03:00
|
|
|
} // end namespace
|
|
|
|
#endif
|