Public Types | Public Member Functions

fst::HashStateTable< T, H > Class Template Reference

#include <fst/state-table.h>

Collaboration diagram for fst::HashStateTable< T, H >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T StateTuple
typedef StateTuple::StateId StateId

Public Member Functions

 HashStateTable ()
StateId FindState (const StateTuple &tuple)
const StateTupleTuple (StateId s) const
StateId Size () const

Detailed Description

template<class T, class H>
class fst::HashStateTable< T, H >

STATE TABLES - these determine the bijective mapping between state tuples (e.g. in composition triples of two FST states and a composition filter state) and their corresponding state IDs. They are classes, templated on state tuples, of the form:

template <class t>=""> class StateTable { public: typedef typename T StateTuple;

Required constructors. StateTable();

Lookup state ID by tuple. If it doesn't exist, then add it. StateId FindState(const StateTuple &); Lookup state tuple by state ID. const StateTuple<StateId> &Tuple(StateId) const; # of stored tuples. StateId Size() const; };

A state tuple has the form:

template <class s>=""> struct StateTuple { typedef typename S StateId;

Required constructor. StateTuple(); }; An implementation using a hash map for the tuple to state ID mapping. The state tuple T must have == defined and the default constructor must produce a tuple that will never be seen. H is the hash function.

Definition at line 68 of file state-table.h.


Member Typedef Documentation

template<class T , class H >
typedef StateTuple::StateId fst::HashStateTable< T, H >::StateId

Definition at line 71 of file state-table.h.

template<class T , class H >
typedef T fst::HashStateTable< T, H >::StateTuple

Definition at line 70 of file state-table.h.


Constructor & Destructor Documentation

template<class T , class H >
fst::HashStateTable< T, H >::HashStateTable (  )  [inline]

Definition at line 73 of file state-table.h.


Member Function Documentation

template<class T , class H >
StateId fst::HashStateTable< T, H >::FindState ( const StateTuple tuple  )  [inline]

Definition at line 77 of file state-table.h.

template<class T , class H >
StateId fst::HashStateTable< T, H >::Size (  )  const [inline]

Definition at line 90 of file state-table.h.

template<class T , class H >
const StateTuple& fst::HashStateTable< T, H >::Tuple ( StateId  s  )  const [inline]

Definition at line 86 of file state-table.h.


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