#ifndef ALONE_VOCAB__ #define ALONE_VOCAB__ #include "lm/word_index.hh" #include "util/string_piece.hh" #include #include #include namespace lm { namespace base { class Vocabulary; } } namespace alone { class Vocab { public: explicit Vocab(const lm::base::Vocabulary &backing); const std::pair &FindOrAdd(const StringPiece &str); const std::pair &EndSentence() const { return end_sentence_; } private: typedef boost::unordered_map Map; Map map_; const lm::base::Vocabulary &backing_; const std::pair &end_sentence_; }; } // namespace alone #endif // ALONE_VCOAB__