Phonetisaurus  1.0
FST-based Grapheme-to-Phoneme conversion
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
LegacyRnnLMHash Class Reference

#include <LegacyRnnLMHash.h>

Public Member Functions

 LegacyRnnLMHash (int class_size)
 
 LegacyRnnLMHash (int class_size, const string g_delim, const string gp_delim)
 
void Split (const std::string &s, char delim, std::vector< std::string > &elems)
 
template<typename I >
int HashInput (I start, I end)
 
void MapToken (string &token)
 
int HashWord (std::string &word) const
 
int FindWord (std::string &word)
 
int GetWordId (std::string &word) const
 
int AddWordToVocab (std::string &word, int cn=1)
 
void SortVocab ()
 
void SetClasses ()
 

Public Attributes

std::vector< size_t > vocab_hash_
 
std::vector< VocabWordvocab_
 
std::vector< ClassIndexclass_sizes_
 
std::unordered_map< int, std::vector< int > > imap
 
fst::SymbolTable isyms
 
int class_size_
 
const char * g_delim_
 
const char * gp_delim_
 

Static Public Attributes

static const std::vector< unsigned int > primes_
 

Detailed Description

Definition at line 32 of file LegacyRnnLMHash.h.

Constructor & Destructor Documentation

LegacyRnnLMHash::LegacyRnnLMHash ( int  class_size)
inline

Definition at line 34 of file LegacyRnnLMHash.h.

LegacyRnnLMHash::LegacyRnnLMHash ( int  class_size,
const string  g_delim,
const string  gp_delim 
)
inline

Definition at line 39 of file LegacyRnnLMHash.h.

Member Function Documentation

int LegacyRnnLMHash::AddWordToVocab ( std::string &  word,
int  cn = 1 
)
inline

Definition at line 119 of file LegacyRnnLMHash.h.

int LegacyRnnLMHash::FindWord ( std::string &  word)
inline

Definition at line 94 of file LegacyRnnLMHash.h.

int LegacyRnnLMHash::GetWordId ( std::string &  word) const
inline

Definition at line 112 of file LegacyRnnLMHash.h.

template<typename I >
int LegacyRnnLMHash::HashInput ( start,
end 
)
inline

Definition at line 54 of file LegacyRnnLMHash.h.

int LegacyRnnLMHash::HashWord ( std::string &  word) const
inline

Definition at line 86 of file LegacyRnnLMHash.h.

void LegacyRnnLMHash::MapToken ( string &  token)
inline

Definition at line 62 of file LegacyRnnLMHash.h.

void LegacyRnnLMHash::SetClasses ( )
inline

Definition at line 139 of file LegacyRnnLMHash.h.

void LegacyRnnLMHash::SortVocab ( )
inline

Definition at line 126 of file LegacyRnnLMHash.h.

void LegacyRnnLMHash::Split ( const std::string &  s,
char  delim,
std::vector< std::string > &  elems 
)
inline

Definition at line 46 of file LegacyRnnLMHash.h.

Member Data Documentation

int LegacyRnnLMHash::class_size_

Definition at line 185 of file LegacyRnnLMHash.h.

std::vector<ClassIndex> LegacyRnnLMHash::class_sizes_

Definition at line 181 of file LegacyRnnLMHash.h.

const char* LegacyRnnLMHash::g_delim_

Definition at line 186 of file LegacyRnnLMHash.h.

const char* LegacyRnnLMHash::gp_delim_

Definition at line 187 of file LegacyRnnLMHash.h.

std::unordered_map<int, std::vector<int> > LegacyRnnLMHash::imap

Definition at line 182 of file LegacyRnnLMHash.h.

fst::SymbolTable LegacyRnnLMHash::isyms

Definition at line 184 of file LegacyRnnLMHash.h.

const std::vector< unsigned int > LegacyRnnLMHash::primes_
static
Initial value:
= {
108641969, 116049371, 125925907, 133333309,
145678979, 175308587, 197530793, 234567803,
251851741, 264197411, 330864029, 399999781,
407407183, 459258997, 479012069, 545678687,
560493491, 607407037, 629629243, 656789717,
716048933, 718518067, 725925469, 733332871,
753085943, 755555077, 782715551, 790122953,
812345159, 814814293, 893826581, 923456189,
940740127, 953085797, 985184539, 990122807
}

Definition at line 44 of file LegacyRnnLMHash.h.

std::vector<VocabWord> LegacyRnnLMHash::vocab_

Definition at line 180 of file LegacyRnnLMHash.h.

std::vector<size_t> LegacyRnnLMHash::vocab_hash_

Definition at line 179 of file LegacyRnnLMHash.h.


The documentation for this class was generated from the following file: