Tanl Linguistic Pipeline |
Two way word index: associates an index to a word and viceversa gets the word with the given index. More...
#include <Vocab.h>
Public Member Functions | |
void | serialize (std::ostream &out) |
void | serialize (std::istream &in) |
int | toindex (std::string const &w) |
std::vector< int > | toindex (std::vector< std::string > &ngram) |
std::string * | toword (int idx) |
int | size () |
Public Attributes | |
std::tr1::unordered_map < std::string, int > | word2id |
std::tr1::unordered_map< int, std::string > | id2word |
Two way word index: associates an index to a word and viceversa gets the word with the given index.
std::vector< int > Tanl::POS::Vocab::toindex | ( | std::vector< std::string > & | ngram | ) |