Tanl Linguistic Pipeline

Tanl::POS::Vocab Struct Reference

Two way word index: associates an index to a word and viceversa gets the word with the given index. More...

#include <Vocab.h>

List of all members.

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

Detailed Description

Two way word index: associates an index to a word and viceversa gets the word with the given index.


Member Function Documentation

std::vector< int > Tanl::POS::Vocab::toindex ( std::vector< std::string > &  ngram  ) 
Returns:
the indexes for all words in ngram.

The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
 
Copyright © 2005-2011 G. Attardi. Generated on 4 Mar 2011 by doxygen 1.6.1.