Classes | Public Types | Public Member Functions | Static Public Member Functions

fst::EncodeTable< A > Class Template Reference

#include <fst/encode.h>

Collaboration diagram for fst::EncodeTable< A >:
Collaboration graph
[legend]

List of all members.

Classes

struct  Tuple
 Encoded data consists of arc input/output labels and arc weight. More...
class  TupleEqual
 Comparison object for hashing EncodeTable Tuple(s). More...
class  TupleKey

Public Types

typedef A::Label Label
typedef A::Weight Weight
typedef unordered_map< const
Tuple *, Label, TupleKey,
TupleEqual
EncodeHash

Public Member Functions

 EncodeTable (uint32 encode_flags)
 ~EncodeTable ()
Label Encode (const A &arc)
 Given an arc encode either input/ouptut labels or input/costs or both.
Label GetLabel (const A &arc) const
 Given an arc, look up its encoded label. Returns kNoLabel if not found.
const TupleDecode (Label key) const
 Given an encode arc Label decode back to input/output labels and costs.
size_t Size () const
bool Write (ostream &strm, const string &source) const
const uint32 flags () const
int RefCount () const
int IncrRefCount ()
int DecrRefCount ()
SymbolTableInputSymbols () const
SymbolTableOutputSymbols () const
void SetInputSymbols (const SymbolTable *syms)
void SetOutputSymbols (const SymbolTable *syms)

Static Public Member Functions

static EncodeTable< A > * Read (istream &strm, const string &source)

Detailed Description

template<class A>
class fst::EncodeTable< A >

The following class encapsulates implementation details for the encoding and decoding of label/weight tuples used for encoding and decoding of Fsts. The EncodeTable is bidirectional. I.E it stores both the Tuple of encode labels and weights to a unique label, and the reverse.

Definition at line 54 of file encode.h.


Member Typedef Documentation

template<class A>
typedef unordered_map<const Tuple*, Label, TupleKey, TupleEqual> fst::EncodeTable< A >::EncodeHash

Definition at line 113 of file encode.h.

template<class A>
typedef A::Label fst::EncodeTable< A >::Label

Definition at line 56 of file encode.h.

template<class A>
typedef A::Weight fst::EncodeTable< A >::Weight

Definition at line 57 of file encode.h.


Constructor & Destructor Documentation

template<class A>
fst::EncodeTable< A >::EncodeTable ( uint32  encode_flags  )  [inline, explicit]

Definition at line 115 of file encode.h.

template<class A>
fst::EncodeTable< A >::~EncodeTable (  )  [inline]

Definition at line 120 of file encode.h.


Member Function Documentation

template<class A>
const Tuple* fst::EncodeTable< A >::Decode ( Label  key  )  const [inline]

Given an encode arc Label decode back to input/output labels and costs.

Definition at line 157 of file encode.h.

template<class A>
int fst::EncodeTable< A >::DecrRefCount (  )  [inline]

Definition at line 175 of file encode.h.

template<class A>
Label fst::EncodeTable< A >::Encode ( const A &  arc  )  [inline]

Given an arc encode either input/ouptut labels or input/costs or both.

Definition at line 129 of file encode.h.

template<class A>
const uint32 fst::EncodeTable< A >::flags (  )  const [inline]

Definition at line 171 of file encode.h.

template<class A>
Label fst::EncodeTable< A >::GetLabel ( const A &  arc  )  const [inline]

Given an arc, look up its encoded label. Returns kNoLabel if not found.

Definition at line 144 of file encode.h.

template<class A>
int fst::EncodeTable< A >::IncrRefCount (  )  [inline]

Definition at line 174 of file encode.h.

template<class A>
SymbolTable* fst::EncodeTable< A >::InputSymbols (  )  const [inline]

Definition at line 178 of file encode.h.

template<class A>
SymbolTable* fst::EncodeTable< A >::OutputSymbols (  )  const [inline]

Definition at line 180 of file encode.h.

template<class A >
EncodeTable< A > * fst::EncodeTable< A >::Read ( istream &  strm,
const string &  source 
) [inline, static]

Definition at line 243 of file encode.h.

template<class A>
int fst::EncodeTable< A >::RefCount (  )  const [inline]

Definition at line 173 of file encode.h.

template<class A>
void fst::EncodeTable< A >::SetInputSymbols ( const SymbolTable syms  )  [inline]

Definition at line 182 of file encode.h.

template<class A>
void fst::EncodeTable< A >::SetOutputSymbols ( const SymbolTable syms  )  [inline]

Definition at line 193 of file encode.h.

template<class A>
size_t fst::EncodeTable< A >::Size (  )  const [inline]

Definition at line 165 of file encode.h.

template<class A >
bool fst::EncodeTable< A >::Write ( ostream &  strm,
const string &  source 
) const [inline]

Definition at line 216 of file encode.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines