00001 #pragma once 00002 00003 #include <map> 00004 00005 #include "lbl/vocabulary.h" 00006 00007 #include "moses/Factor.h" 00008 #include "moses/Phrase.h" 00009 00010 namespace Moses 00011 { 00012 00013 class OxLMMapper 00014 { 00015 public: 00016 OxLMMapper( 00017 const boost::shared_ptr<oxlm::Vocabulary>& vocab, 00018 bool pos_back_off, 00019 const FactorType& pos_factor_type); 00020 00021 int convert(const Word& word) const; 00022 00023 void convert( 00024 const std::vector<const Word*> &contextFactor, 00025 std::vector<int> &ids, 00026 int &word) const; 00027 00028 protected: 00029 bool posBackOff; 00030 FactorType posFactorType; 00031 00032 typedef std::map<const Moses::Factor*, int> Coll; 00033 Coll moses2Oxlm; 00034 int kUNKNOWN; 00035 }; 00036 00037 } // namespace Moses