1 #ifndef __ZGEN_WORD_ALPHABET_H__
2 #define __ZGEN_WORD_ALPHABET_H__
5 #include <boost/unordered_map.hpp>
6 #include <boost/serialization/string.hpp>
7 #include <boost/serialization/vector.hpp>
8 #include <boost/serialization/version.hpp>
9 #include <boost/serialization/split_member.hpp>
10 #include <boost/serialization/singleton.hpp>
31 int insert(
const char* name);
40 const char*
decode(
int id)
const;
47 int encode(
const char* name)
const;
53 bool save(std::ostream& ofs)
const;
60 bool load(std::istream& ifs);
67 typedef boost::unordered_map<std::string, int> map_t;
71 std::vector<std::string> id2name;
77 template<
class Archive>
78 void serialize(Archive & ar,
const unsigned int version) {
90 #endif // end for __ZGEN_WORD_ALPHABET_H__
bool save(std::ostream &ofs) const
Definition: word_alphabet.cc:59
Definition: word_alphabet.h:63
Definition: word_alphabet.h:63
int insert(const char *name)
Definition: word_alphabet.cc:25
bool load(std::istream &ifs)
Definition: word_alphabet.cc:72
Definition: alphabet.h:30
const char * decode(int id) const
Definition: word_alphabet.cc:40
friend class boost::serialization::access
Definition: word_alphabet.h:69
SPECIAL_WORD
Definition: word_alphabet.h:62
~WordAlphabet()
Definition: word_alphabet.cc:21
WordAlphabet()
Definition: word_alphabet.cc:11
int encode(const char *name) const
Definition: word_alphabet.cc:49
void serialize(Archive &ar, boost::unordered_map< Key, Type, Hash, Compare, Allocator > &t, const unsigned int file_version)
Definition: unordered_map.h:64
Definition: word_alphabet.h:18
Definition: word_alphabet.h:63