FST  openfst-1.8.3
OpenFst Library
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
fst::NGramFst< A > Class Template Reference

#include <ngram-fst.h>

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

Public Types

typedef A Arc
 
typedef A::StateId StateId
 
typedef A::Label Label
 
typedef A::Weight Weight
 
typedef internal::NGramFstImpl< A > Impl
 
- Public Types inherited from fst::ImplToExpandedFst< internal::NGramFstImpl< A > >
using Arc = typename ExpandedFst< typename internal::NGramFstImpl< A >::Arc >::Arc
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
- Public Types inherited from fst::ImplToFst< internal::NGramFstImpl< A >, ExpandedFst< typename internal::NGramFstImpl< A >::Arc > >
using Arc = typename internal::NGramFstImpl< A >::Arc
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
- Public Types inherited from fst::ExpandedFst< typename internal::NGramFstImpl< A >::Arc >
using Arc = typename internal::NGramFstImpl< A >::Arc
 
using StateId = typename Arc::StateId
 
- Public Types inherited from fst::Fst< A >
using Arc = A
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 

Public Member Functions

 NGramFst (const Fst< A > &dst)
 
 NGramFst (const Fst< A > &fst, std::vector< StateId > *order_out)
 
 NGramFst (const NGramFst< A > &fst, bool safe=false)
 
 NGramFst ()
 
 NGramFst (const char *data)
 
const char * GetData (size_t *data_size) const
 
const std::vector< LabelGetContext (StateId s) const
 
void GetStates (const std::vector< Label > &context, std::vector< StateId > *state) const
 
size_t NumArcs (StateId s) const override
 
NGramFst< A > * Copy (bool safe=false) const override
 
bool Write (std::ostream &strm, const FstWriteOptions &opts) const override
 
bool Write (const std::string &source) const override
 
void InitStateIterator (StateIteratorData< A > *data) const override
 
void InitArcIterator (StateId s, ArcIteratorData< A > *data) const override
 
MatcherBase< A > * InitMatcher (MatchType match_type) const override
 
size_t StorageSize () const
 
- Public Member Functions inherited from fst::ImplToExpandedFst< internal::NGramFstImpl< A > >
StateId NumStates () const override
 
- Public Member Functions inherited from fst::ImplToFst< internal::NGramFstImpl< A >, ExpandedFst< typename internal::NGramFstImpl< A >::Arc > >
StateId Start () const override
 
Weight Final (StateId s) const override
 
size_t NumArcs (StateId s) const override
 
size_t NumInputEpsilons (StateId s) const override
 
size_t NumOutputEpsilons (StateId s) const override
 
uint64_t Properties (uint64_t mask, bool test) const override
 
const std::string & Type () const override
 
const SymbolTableInputSymbols () const override
 
const SymbolTableOutputSymbols () const override
 
- Public Member Functions inherited from fst::ExpandedFst< typename internal::NGramFstImpl< A >::Arc >
std::optional< StateIdNumStatesIfKnown () const override
 
- Public Member Functions inherited from fst::Fst< A >
virtual ~Fst ()=default
 
virtual void InitArcIterator (StateId s, ArcIteratorData< Arc > *data) const =0
 

Static Public Member Functions

static NGramFst< A > * Read (std::istream &strm, const FstReadOptions &opts)
 
static NGramFst< A > * Read (const std::string &source)
 
static bool HasRequiredProps (const Fst< A > &fst)
 
static bool HasRequiredStructure (const Fst< A > &fst)
 
- Static Public Member Functions inherited from fst::ExpandedFst< typename internal::NGramFstImpl< A >::Arc >
static ExpandedFstRead (std::istream &strm, const FstReadOptions &opts)
 
static ExpandedFstRead (std::string_view source)
 
- Static Public Member Functions inherited from fst::Fst< A >
static FstRead (std::istream &strm, const FstReadOptions &opts)
 
static FstRead (const std::string &source)
 

Friends

class ArcIterator< NGramFst< A > >
 
class NGramFstMatcher< A >
 

Additional Inherited Members

- Protected Member Functions inherited from fst::ImplToExpandedFst< internal::NGramFstImpl< A > >
 ImplToExpandedFst (std::shared_ptr< internal::NGramFstImpl< A > > impl)
 
 ImplToExpandedFst (const ImplToExpandedFst &fst, bool safe)
 
- Protected Member Functions inherited from fst::ImplToFst< internal::NGramFstImpl< A >, ExpandedFst< typename internal::NGramFstImpl< A >::Arc > >
 ImplToFst (std::shared_ptr< internal::NGramFstImpl< A > > impl)
 
 ImplToFst (const ImplToFst &fst, bool safe)
 
 ImplToFst ()=delete
 
 ImplToFst (const ImplToFst &fst)
 
 ImplToFst (ImplToFst &&fst) noexcept
 
ImplToFstoperator= (const ImplToFst &fst)
 
ImplToFstoperator= (ImplToFst &&fst) noexcept
 
const internal::NGramFstImpl< A > * GetImpl () const
 
internal::NGramFstImpl< A > * GetMutableImpl () const
 
std::shared_ptr< internal::NGramFstImpl< A > > GetSharedImpl () const
 
bool Unique () const
 
void SetImpl (std::shared_ptr< internal::NGramFstImpl< A > > impl)
 
- Protected Member Functions inherited from fst::Fst< A >
bool WriteFile (const std::string &source) const
 
- Static Protected Member Functions inherited from fst::ImplToExpandedFst< internal::NGramFstImpl< A > >
static internal::NGramFstImpl< A > * Read (std::istream &strm, const FstReadOptions &opts)
 
static internal::NGramFstImpl< A > * Read (std::string_view source)
 

Detailed Description

template<class A>
class fst::NGramFst< A >

Definition at line 57 of file ngram-fst.h.

Member Typedef Documentation

template<class A>
typedef A fst::NGramFst< A >::Arc

Definition at line 355 of file ngram-fst.h.

template<class A>
typedef internal::NGramFstImpl<A> fst::NGramFst< A >::Impl

Definition at line 359 of file ngram-fst.h.

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

Definition at line 357 of file ngram-fst.h.

template<class A>
typedef A::StateId fst::NGramFst< A >::StateId

Definition at line 356 of file ngram-fst.h.

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

Definition at line 358 of file ngram-fst.h.

Constructor & Destructor Documentation

template<class A>
fst::NGramFst< A >::NGramFst ( const Fst< A > &  dst)
inlineexplicit

Definition at line 361 of file ngram-fst.h.

template<class A>
fst::NGramFst< A >::NGramFst ( const Fst< A > &  fst,
std::vector< StateId > *  order_out 
)
inline

Definition at line 364 of file ngram-fst.h.

template<class A>
fst::NGramFst< A >::NGramFst ( const NGramFst< A > &  fst,
bool  safe = false 
)
inline

Definition at line 369 of file ngram-fst.h.

template<class A>
fst::NGramFst< A >::NGramFst ( )
inline

Definition at line 372 of file ngram-fst.h.

template<class A>
fst::NGramFst< A >::NGramFst ( const char *  data)
inlineexplicit

Definition at line 376 of file ngram-fst.h.

Member Function Documentation

template<class A>
NGramFst<A>* fst::NGramFst< A >::Copy ( bool  safe = false) const
inlineoverridevirtual
template<class A>
const std::vector<Label> fst::NGramFst< A >::GetContext ( StateId  s) const
inline

Definition at line 386 of file ngram-fst.h.

template<class A>
const char* fst::NGramFst< A >::GetData ( size_t *  data_size) const
inline

Definition at line 382 of file ngram-fst.h.

template<class A>
void fst::NGramFst< A >::GetStates ( const std::vector< Label > &  context,
std::vector< StateId > *  state 
) const
inline

Definition at line 392 of file ngram-fst.h.

template<class A>
static bool fst::NGramFst< A >::HasRequiredProps ( const Fst< A > &  fst)
inlinestatic

Definition at line 445 of file ngram-fst.h.

template<class A>
static bool fst::NGramFst< A >::HasRequiredStructure ( const Fst< A > &  fst)
inlinestatic

Definition at line 451 of file ngram-fst.h.

template<class A >
void fst::NGramFst< A >::InitArcIterator ( StateId  s,
ArcIteratorData< A > *  data 
) const
inlineoverride

Definition at line 489 of file ngram-fst.h.

template<class A>
MatcherBase<A>* fst::NGramFst< A >::InitMatcher ( MatchType  match_type) const
inlineoverridevirtual

Reimplemented from fst::Fst< A >.

Definition at line 439 of file ngram-fst.h.

template<class A>
void fst::NGramFst< A >::InitStateIterator ( StateIteratorData< A > *  data) const
inlineoverridevirtual

Implements fst::Fst< A >.

Definition at line 432 of file ngram-fst.h.

template<class A>
size_t fst::NGramFst< A >::NumArcs ( StateId  s) const
inlineoverride

Definition at line 397 of file ngram-fst.h.

template<class A>
static NGramFst<A>* fst::NGramFst< A >::Read ( std::istream &  strm,
const FstReadOptions opts 
)
inlinestatic

Definition at line 405 of file ngram-fst.h.

template<class A>
static NGramFst<A>* fst::NGramFst< A >::Read ( const std::string &  source)
inlinestatic

Definition at line 410 of file ngram-fst.h.

template<class A>
size_t fst::NGramFst< A >::StorageSize ( ) const
inline

Definition at line 443 of file ngram-fst.h.

template<class A>
bool fst::NGramFst< A >::Write ( std::ostream &  strm,
const FstWriteOptions opts 
) const
inlineoverridevirtual

Reimplemented from fst::Fst< A >.

Definition at line 424 of file ngram-fst.h.

template<class A>
bool fst::NGramFst< A >::Write ( const std::string &  source) const
inlineoverridevirtual

Reimplemented from fst::Fst< A >.

Definition at line 428 of file ngram-fst.h.

Friends And Related Function Documentation

template<class A>
friend class ArcIterator< NGramFst< A > >
friend

Definition at line 351 of file ngram-fst.h.

template<class A>
friend class NGramFstMatcher< A >
friend

Definition at line 352 of file ngram-fst.h.


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