FST  openfst-1.6.1
OpenFst Library
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore > Class Template Reference

#include <compact-fst.h>

Inheritance diagram for fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >:
Inheritance graph
[legend]
Collaboration diagram for fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >:
Collaboration graph
[legend]

Public Types

using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
using DataStorage = CompactStore
 
using ImplBase = CacheBaseImpl< typename CacheStore::State, CacheStore >
 
- Public Types inherited from fst::internal::CacheBaseImpl< CacheStore::State, CacheStore >
using Arc = typename CacheStore::State::Arc
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
using Store = CacheStore
 
- Public Types inherited from fst::internal::FstImpl< CacheStore::State::Arc >
using StateId = typename CacheStore::State::Arc::StateId
 
using Weight = typename CacheStore::State::Arc::Weight
 

Public Member Functions

 CompactFstImpl ()
 
 CompactFstImpl (const Fst< Arc > &fst, std::shared_ptr< Compactor > compactor, const CompactFstOptions &opts, std::shared_ptr< CompactStore > data)
 
template<class Iterator >
 CompactFstImpl (const Iterator &b, const Iterator &e, std::shared_ptr< Compactor > compactor, const CompactFstOptions &opts)
 
 CompactFstImpl (const CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore > &impl)
 
template<class OtherCacheStore >
 CompactFstImpl (const CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, OtherCacheStore > &impl)
 
StateId Start ()
 
Weight Final (StateId s)
 
StateId NumStates () const
 
size_t NumArcs (StateId s)
 
size_t NumInputEpsilons (StateId s)
 
size_t NumOutputEpsilons (StateId s)
 
size_t CountEpsilons (StateId s, bool output_epsilons)
 
bool Write (std::ostream &strm, const FstWriteOptions &opts) const
 
void InitStateIterator (StateIteratorData< Arc > *data) const
 
void InitArcIterator (StateId s, ArcIteratorData< Arc > *data)
 
Arc ComputeArc (StateId s, Unsigned i, uint32 f=kArcValueFlags) const
 
void Expand (StateId s)
 
template<class Iterator >
void SetCompactElements (const Iterator &begin, const Iterator &end)
 
const Compactor * GetCompactor () const
 
std::shared_ptr< Compactor > SharedCompactor () const
 
const CompactStore * Data () const
 
std::shared_ptr< CompactStore > SharedData () const
 
- Public Member Functions inherited from fst::internal::CacheBaseImpl< CacheStore::State, CacheStore >
 CacheBaseImpl (const CacheOptions &opts=CacheOptions())
 
 CacheBaseImpl (const CacheImplOptions< CacheStore > &opts)
 
 CacheBaseImpl (const CacheBaseImpl< CacheStore::State, CacheStore > &impl, bool preserve_cache=false)
 
 ~CacheBaseImpl () override
 
void SetStart (StateId s)
 
void SetFinal (StateId s, Weight weight)
 
void PushArc (StateId s, const Arc &arc)
 
void SetArcs (StateId s)
 
void ReserveArcs (StateId s, size_t n)
 
void DeleteArcs (StateId s)
 
void DeleteArcs (StateId s, size_t n)
 
void Clear ()
 
bool HasStart () const
 
bool HasFinal (StateId s) const
 
bool HasArcs (StateId s) const
 
StateId Start () const
 
Weight Final (StateId s) const
 
size_t NumArcs (StateId s) const
 
size_t NumInputEpsilons (StateId s) const
 
size_t NumOutputEpsilons (StateId s) const
 
void InitArcIterator (StateId s, ArcIteratorData< Arc > *data) const
 
StateId NumKnownStates () const
 
void UpdateNumKnownStates (StateId s)
 
StateId MinUnexpandedState () const
 
StateId MaxExpandedState () const
 
void SetExpandedState (StateId s)
 
bool ExpandedState (StateId s) const
 
const CacheStore * GetCacheStore () const
 
CacheStore * GetCacheStore ()
 
bool GetCacheGc () const
 
size_t GetCacheLimit () const
 
- Public Member Functions inherited from fst::internal::FstImpl< CacheStore::State::Arc >
 FstImpl ()
 
 FstImpl (const FstImpl< CacheStore::State::Arc > &impl)
 
virtual ~FstImpl ()
 
const string & Type () const
 
void SetType (const string &type)
 
virtual uint64 Properties () const
 
virtual uint64 Properties (uint64 mask) const
 
void SetProperties (uint64 props)
 
void SetProperties (uint64 props, uint64 mask)
 
void SetProperties (uint64 props, uint64 mask) const
 
const SymbolTableInputSymbols () const
 
SymbolTableInputSymbols ()
 
const SymbolTableOutputSymbols () const
 
SymbolTableOutputSymbols ()
 
void SetInputSymbols (const SymbolTable *isyms)
 
void SetOutputSymbols (const SymbolTable *osyms)
 
bool ReadHeader (std::istream &strm, const FstReadOptions &opts, int min_version, FstHeader *hdr)
 
void WriteHeader (std::ostream &strm, const FstWriteOptions &opts, int version, FstHeader *hdr) const
 

Static Public Member Functions

static CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore > * Read (std::istream &strm, const FstReadOptions &opts)
 
- Static Public Member Functions inherited from fst::internal::FstImpl< CacheStore::State::Arc >
static void WriteFstHeader (const Fst< CacheStore::State::Arc > &fst, std::ostream &strm, const FstWriteOptions &opts, int version, const string &type, uint64 properties, FstHeader *hdr)
 
static bool UpdateFstHeader (const Fst< CacheStore::State::Arc > &fst, std::ostream &strm, const FstWriteOptions &opts, int version, const string &type, uint64 properties, FstHeader *hdr, size_t header_offset)
 

Static Public Attributes

static constexpr uint64 kStaticProperties = kExpanded
 

Protected Member Functions

template<class OtherArc , class OtherCompactor , class OtherCacheStore >
 CompactFstImpl (const CompactFstImpl< OtherArc, OtherCompactor, Unsigned, CompactStore, OtherCacheStore > &impl)
 

Friends

class CompactFst< Arc, Compactor, Unsigned, CompactStore, CacheStore >
 

Additional Inherited Members

- Protected Attributes inherited from fst::internal::FstImpl< CacheStore::State::Arc >
uint64 properties_
 

Detailed Description

template<class Arc, class Compactor, class Unsigned, class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
class fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >

Definition at line 426 of file compact-fst.h.

Member Typedef Documentation

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
using fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::DataStorage = CompactStore

Definition at line 431 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
using fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::ImplBase = CacheBaseImpl<typename CacheStore::State, CacheStore>

Definition at line 440 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
using fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::StateId = typename Arc::StateId

Definition at line 429 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
using fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Weight = typename Arc::Weight

Definition at line 430 of file compact-fst.h.

Constructor & Destructor Documentation

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CompactFstImpl ( )
inline

Definition at line 449 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CompactFstImpl ( const Fst< Arc > &  fst,
std::shared_ptr< Compactor >  compactor,
const CompactFstOptions opts,
std::shared_ptr< CompactStore >  data 
)
inline

Definition at line 469 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
template<class Iterator >
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CompactFstImpl ( const Iterator &  b,
const Iterator &  e,
std::shared_ptr< Compactor >  compactor,
const CompactFstOptions opts 
)
inline

Definition at line 477 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CompactFstImpl ( const CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore > &  impl)
inline

Definition at line 484 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
template<class OtherCacheStore >
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CompactFstImpl ( const CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, OtherCacheStore > &  impl)
inlineexplicit

Definition at line 499 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
template<class OtherArc , class OtherCompactor , class OtherCacheStore >
fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CompactFstImpl ( const CompactFstImpl< OtherArc, OtherCompactor, Unsigned, CompactStore, OtherCacheStore > &  impl)
inlineexplicitprotected

Definition at line 670 of file compact-fst.h.

Member Function Documentation

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
Arc fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::ComputeArc ( StateId  s,
Unsigned  i,
uint32  f = kArcValueFlags 
) const
inline

Definition at line 629 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
size_t fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::CountEpsilons ( StateId  s,
bool  output_epsilons 
)
inline

Definition at line 564 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
const CompactStore* fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Data ( ) const
inline

Definition at line 661 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
void fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Expand ( StateId  s)
inline

Definition at line 633 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
Weight fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Final ( StateId  s)
inline

Definition at line 518 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
const Compactor* fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::GetCompactor ( ) const
inline

Definition at line 657 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
void fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::InitArcIterator ( StateId  s,
ArcIteratorData< Arc > *  data 
)
inline

Definition at line 624 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
void fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::InitStateIterator ( StateIteratorData< Arc > *  data) const
inline

Definition at line 619 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
size_t fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::NumArcs ( StateId  s)
inline

Definition at line 534 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
size_t fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::NumInputEpsilons ( StateId  s)
inline

Definition at line 552 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
size_t fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::NumOutputEpsilons ( StateId  s)
inline

Definition at line 558 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
StateId fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::NumStates ( ) const
inline

Definition at line 529 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
static CompactFstImpl<Arc, Compactor, Unsigned, CompactStore, CacheStore>* fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Read ( std::istream &  strm,
const FstReadOptions opts 
)
inlinestatic

Definition at line 585 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
template<class Iterator >
void fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::SetCompactElements ( const Iterator &  begin,
const Iterator &  end 
)
inline

Definition at line 651 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
std::shared_ptr<Compactor> fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::SharedCompactor ( ) const
inline

Definition at line 659 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
std::shared_ptr<CompactStore> fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::SharedData ( ) const
inline

Definition at line 663 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
StateId fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Start ( )
inline

Definition at line 513 of file compact-fst.h.

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
bool fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::Write ( std::ostream &  strm,
const FstWriteOptions opts 
) const
inline

Definition at line 606 of file compact-fst.h.

Friends And Related Function Documentation

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
friend class CompactFst< Arc, Compactor, Unsigned, CompactStore, CacheStore >
friend

Definition at line 684 of file compact-fst.h.

Member Data Documentation

template<class Arc , class Compactor , class Unsigned , class CompactStore = DefaultCompactStore<typename Compactor::Element, Unsigned>, class CacheStore = DefaultCacheStore<Arc>>
constexpr uint64 fst::internal::CompactFstImpl< Arc, Compactor, Unsigned, CompactStore, CacheStore >::kStaticProperties = kExpanded
static

Definition at line 666 of file compact-fst.h.


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