All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ContextFst< Arc, LabelT > Class Template Reference

#include <context-fst.h>

Inheritance diagram for ContextFst< Arc, LabelT >:
Collaboration diagram for ContextFst< Arc, LabelT >:

Public Types

typedef Arc::Weight Weight
 
typedef Arc::Label Label
 
typedef Arc::StateId StateId
 
typedef CacheState< Arc > State
 

Public Member Functions

 ContextFst (Label subsequential_symbol, const vector< LabelT > &phones, const vector< LabelT > &disambig_syms, int32 N, int32 P)
 See The ContextFst object for more details. More...
 
 ContextFst (const ContextFst< Arc, LabelT > &fst, bool reset=false)
 
virtual ~ContextFst ()
 
virtual StateId Start () const
 
virtual Weight Final (StateId s) const
 
StateId NumStates () const
 
bool CreateArc (StateId s, Label olabel, Arc *oarc) const
 
size_t NumArcs (StateId s) const
 
size_t NumInputEpsilons (StateId s) const
 
size_t NumOutputEpsilons (StateId s) const
 
virtual uint64 Properties (uint64 mask, bool test) const
 
const vector< vector< LabelT > > & ILabelInfo ()
 
virtual const string & Type () const
 
virtual ContextFst< Arc > * Copy (bool reset=false) const
 
virtual const SymbolTable * InputSymbols () const
 
virtual const SymbolTable * OutputSymbols () const
 
virtual void InitStateIterator (StateIteratorData< Arc > *data) const
 
virtual void InitArcIterator (StateId s, ArcIteratorData< Arc > *data) const
 

Private Member Functions

ContextFstImpl< Arc, LabelT > * GetImpl () const
 
void operator= (const ContextFstImpl< Arc > &fst)
 

Private Attributes

ContextFstImpl< Arc, LabelT > * impl_
 

Friends

class ArcIterator< ContextFst< Arc > >
 
class StateIterator< ContextFst< Arc > >
 
class CacheArcIterator< ContextFst< Arc >, DefaultCacheStateAllocator< CacheState< Arc > > >
 
class CacheStateIterator< ContextFst< Arc > >
 

Detailed Description

template<class Arc, class LabelT = int32>
class fst::ContextFst< Arc, LabelT >

Definition at line 215 of file context-fst.h.

Member Typedef Documentation

typedef Arc::Label Label

Definition at line 227 of file context-fst.h.

typedef CacheState<Arc> State

Definition at line 233 of file context-fst.h.

typedef Arc::StateId StateId

Definition at line 228 of file context-fst.h.

typedef Arc::Weight Weight

Definition at line 226 of file context-fst.h.

Constructor & Destructor Documentation

ContextFst ( Label  subsequential_symbol,
const vector< LabelT > &  phones,
const vector< LabelT > &  disambig_syms,
int32  N,
int32  P 
)
inline

See The ContextFst object for more details.

Definition at line 237 of file context-fst.h.

241  : // Pos of "central" phone in ctx window, from 0..N-1.
242  impl_ (new ContextFstImpl<Arc, LabelT>(subsequential_symbol, phones, disambig_syms, N, P))
243  { assert(std::numeric_limits<LabelT>::is_signed); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual ~ContextFst ( )
inlinevirtual

Definition at line 247 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

247 { if (!impl_->DecrRefCount()) delete impl_; }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310

Member Function Documentation

virtual ContextFst<Arc>* Copy ( bool  reset = false) const
inlinevirtual

Definition at line 290 of file context-fst.h.

290  {
291  return new ContextFst<Arc>(*this, reset);
292  }
bool CreateArc ( StateId  s,
Label  olabel,
Arc *  oarc 
) const
inline

Definition at line 261 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

Referenced by ContextMatcher< Arc, LabelT >::Find().

261  {
262  return impl_->CreateArc(s, olabel, oarc);
263  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual Weight Final ( StateId  s) const
inlinevirtual

Definition at line 251 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

251 { return impl_->Final(s); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
ContextFstImpl<Arc, LabelT>* GetImpl ( ) const
inlineprivate

Definition at line 312 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

Referenced by ArcIterator< ContextFst< A > >::ArcIterator().

312 { return impl_; }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
const vector<vector<LabelT> >& ILabelInfo ( )
inline

Definition at line 286 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

Referenced by TrainingGraphCompiler::CompileGraphs(), fst::ComposeContext(), and fst::TestContextFst().

286 { return impl_->ILabelInfo(); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual void InitArcIterator ( StateId  s,
ArcIteratorData< Arc > *  data 
) const
inlinevirtual

Definition at line 304 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

304  {
305  impl_->InitArcIterator(s, data);
306  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual const SymbolTable* InputSymbols ( ) const
inlinevirtual

Definition at line 294 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

Referenced by fst::TestContextFst().

294  {
295  return impl_->InputSymbols();
296  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
size_t NumArcs ( StateId  s) const
inline

Definition at line 265 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

265 { return impl_->NumArcs(s); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
size_t NumInputEpsilons ( StateId  s) const
inline

Definition at line 267 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

267  {
268  return impl_->NumInputEpsilons(s);
269  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
size_t NumOutputEpsilons ( StateId  s) const
inline

Definition at line 271 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

271  {
272  return impl_->NumOutputEpsilons(s);
273  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
StateId NumStates ( ) const
inline

Definition at line 253 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

253 { return impl_->NumStates(); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
void operator= ( const ContextFstImpl< Arc > &  fst)
private
virtual const SymbolTable* OutputSymbols ( ) const
inlinevirtual

Definition at line 298 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

Referenced by fst::TestContextFst().

298  {
299  return impl_->OutputSymbols();
300  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual uint64 Properties ( uint64  mask,
bool  test 
) const
inlinevirtual

Definition at line 275 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

275  {
276  if (test) {
277  uint64 knownprops, testprops = TestProperties(*this, mask, &knownprops);
278  impl_->SetProperties(knownprops, testprops);
279  return testprops & mask;
280  } else {
281  return impl_->Properties(mask);
282  }
283  }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual StateId Start ( ) const
inlinevirtual

Definition at line 249 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

249 { return impl_->Start(); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310
virtual const string& Type ( ) const
inlinevirtual

Definition at line 288 of file context-fst.h.

References ContextFst< Arc, LabelT >::impl_.

288 { return impl_->Type(); }
ContextFstImpl< Arc, LabelT > * impl_
Definition: context-fst.h:310

Friends And Related Function Documentation

friend class ArcIterator< ContextFst< Arc > >
friend

Definition at line 217 of file context-fst.h.

friend class CacheArcIterator< ContextFst< Arc >,DefaultCacheStateAllocator< CacheState< Arc > > >
friend

Definition at line 223 of file context-fst.h.

friend class CacheStateIterator< ContextFst< Arc > >
friend

Definition at line 308 of file context-fst.h.

friend class StateIterator< ContextFst< Arc > >
friend

Definition at line 218 of file context-fst.h.

Member Data Documentation


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