FST  openfst-1.8.2
OpenFst Library
Classes | Typedefs | Functions | Variables
fst::internal Namespace Reference

Classes

class  AcyclicMinimizer
 
class  AddOnImpl
 
class  ArcMapFstImpl
 
class  CacheBaseImpl
 
class  CacheImpl
 
class  CompactFstImpl
 
class  ComplementFstImpl
 
class  ComposeFstImpl
 
class  ComposeFstImplBase
 
class  CompositeWeightIO
 
class  ConstFstImpl
 
class  ConstSymbolTableImpl
 
class  CyclicMinimizer
 
class  DenseSymbolMap
 
struct  DeterminizeArc
 
struct  DeterminizeElement
 
class  DeterminizeFsaImpl
 
class  DeterminizeFstImpl
 
class  DeterminizeFstImplBase
 
struct  DeterminizeStateTuple
 
struct  DfsState
 
class  Disambiguator
 
class  EditFstData
 
class  EditFstImpl
 
class  EncodeTable
 
struct  EquivalenceUtil
 
struct  ErrorLess
 
class  FactorWeightFstImpl
 
struct  FirstPathSelect
 
class  FirstPathSelect< S, W, NaturalAStarQueue< S, W, Estimate > >
 
class  FstImpl
 
class  Isomorphism
 
struct  KeyLookupReferenceType
 
struct  KeyLookupReferenceType< std::string >
 
class  KeyPair
 
struct  KeyPairHasher
 
class  LinearClassifierFstImpl
 
class  LinearTaggerFstImpl
 
class  MemoryArenaImpl
 
class  MemoryPoolImpl
 
class  MPdtExpandFstImpl
 
class  MPdtStack
 
class  MutableSymbolTableImpl
 
class  NGramFstImpl
 
struct  ParenState
 
class  Partition
 
class  PartitionIterator
 
class  PdtBalanceData
 
class  PdtExpandFstImpl
 
class  PdtParenReachable
 
class  PdtShortestPathData
 
class  PhiFstMatcherData
 
class  PruneCompare
 
class  RandGenFstImpl
 
class  RandGenVisitor
 
class  RationalFstImpl
 
class  RelabelFstImpl
 
class  RelationDeterminizeFilter
 
class  ReplaceFstImpl
 
struct  ReplaceParenHash
 
class  RhoFstMatcherData
 
class  RmEpsilonFstImpl
 
class  RmEpsilonState
 
class  ShortestDistanceState
 
class  ShortestPathCompare
 
class  SigmaFstMatcherData
 
class  SpanIterator
 
class  StateComparator
 
class  StateMapFstImpl
 
class  StateWeightCompare
 
class  StringReader
 
class  StringSplitter
 
class  SymbolTableImpl
 
class  SymbolTableImplBase
 
class  SynchronizeFstImpl
 
struct  type_identity
 
class  VectorFstBaseImpl
 
class  VectorFstImpl
 

Typedefs

template<typename T >
using type_identity_t = typename type_identity< T >::type
 
template<typename StackId , typename Level , Level nlevels>
using StackConfig = std::array< StackId, nlevels >
 

Functions

int KeySize (const std::string &source)
 
template<class Compactor , class Arc >
const Compactor * GetCompactor (const CompactFst< Arc, Compactor > &fst)
 
template<class Compactor , class Arc >
const Compactor * GetCompactor (const Fst< Arc > &fst)
 
template<class S >
size_t GetResultSize (const std::vector< S > &elements, size_t s_size)
 
template<class Arc >
Arc::Weight Final (const ExpandedFst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
ssize_t NumArcs (const ExpandedFst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
ssize_t NumInputEpsilons (const ExpandedFst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
ssize_t NumOutputEpsilons (const ExpandedFst< Arc > &fst, typename Arc::StateId s)
 
template<class Var , class Edge >
bool ExpandLZCode (const std::vector< std::pair< Var, Edge >> &code, std::vector< std::vector< Edge >> *expanded_code)
 
template<class Arc , class Functor >
void Map (FarReader< Arc > &reader, FarWriter< Arc > &writer, Functor functor)
 
template<class Arc , class Functor >
bool MapAllReduce (FarReader< Arc > &reader1, FarReader< Arc > &reader2, Functor functor, std::string_view begin_key="", std::string_view end_key="")
 
template<class T >
constexpr bool IsNan (T value)
 
double LogPosExp (double x)
 
double LogNegExp (double x)
 
double KahanLogSum (double a, double b, double *c)
 
double KahanLogDiff (double a, double b, double *c)
 
double KahanRealSum (double a, double b, double *c)
 
template<class F >
F::Arc::Weight Final (const F &fst, typename F::Arc::StateId s)
 
template<class F >
ssize_t NumArcs (const F &fst, typename F::Arc::StateId s)
 
template<class F >
ssize_t NumInputEpsilons (const F &fst, typename F::Arc::StateId s)
 
template<class F >
ssize_t NumOutputEpsilons (const F &fst, typename F::Arc::StateId s)
 
template<class Arc >
Arc::Weight Final (const Fst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
size_t NumArcs (const Fst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
size_t NumInputEpsilons (const Fst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
size_t NumOutputEpsilons (const Fst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
uint64_t TestProperties (const Fst< Arc > &fst, uint64_t mask, uint64_t *known)
 
template<class Weight , typename std::enable_if_t< IsIdempotent< Weight >::value > * = nullptr>
bool WeightCompare (const Weight &w1, const Weight &w2, float, bool *)
 
template<class Arc >
void MergeStates (const Partition< typename Arc::StateId > &partition, MutableFst< Arc > *fst)
 
template<class Arc >
void AcceptorMinimize (MutableFst< Arc > *fst)
 
template<class Arc >
Arc::Weight Final (const MutableFst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
ssize_t NumArcs (const MutableFst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
ssize_t NumInputEpsilons (const MutableFst< Arc > &fst, typename Arc::StateId s)
 
template<class Arc >
ssize_t NumOutputEpsilons (const MutableFst< Arc > &fst, typename Arc::StateId s)
 
uint64_t KnownProperties (uint64_t props)
 
bool CompatProperties (uint64_t props1, uint64_t props2)
 
template<class Arc >
void SingleShortestPathBacktrace (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, const std::vector< std::pair< typename Arc::StateId, size_t >> &parent, typename Arc::StateId f_parent)
 
template<class Arc , class Queue , class ArcFilter >
bool SingleShortestPath (const Fst< Arc > &ifst, std::vector< typename Arc::Weight > *distance, const ShortestPathOptions< Arc, Queue, ArcFilter > &opts, typename Arc::StateId *f_parent, std::vector< std::pair< typename Arc::StateId, size_t >> *parent)
 
template<class Arc , class RevArc >
void NShortestPath (const Fst< RevArc > &ifst, MutableFst< Arc > *ofst, const std::vector< typename Arc::Weight > &distance, int32_t nshortest, float delta=kShortestDelta, typename Arc::Weight weight_threshold=Arc::Weight::Zero(), typename Arc::StateId state_threshold=kNoStateId)
 
template<class Label >
bool ConvertSymbolToLabel (std::string_view str, const SymbolTable *syms, Label unknown_label, bool allow_negative, Label *output)
 
template<class Label >
bool ConvertStringToLabels (std::string_view str, TokenType token_type, const SymbolTable *syms, Label unknown_label, bool allow_negative, std::vector< Label > *labels, const std::string &sep=FST_FLAGS_fst_field_separator)
 
template<class Label >
bool LabelsToSymbolString (const std::vector< Label > &labels, std::string *str, const SymbolTable &syms, std::string_view sep, bool omit_epsilon)
 
template<class Label >
bool LabelsToNumericString (const std::vector< Label > &labels, std::string *str, std::string_view sep, bool omit_epsilon)
 
template<class Arc >
uint64_t ComputeProperties (const Fst< Arc > &fst, uint64_t mask, uint64_t *known)
 
template<class Arc >
uint64_t ComputeOrUseStoredProperties (const Fst< Arc > &fst, uint64_t mask, uint64_t *known)
 
template<class Arc >
uint64_t CheckProperties (const Fst< Arc > &fst, uint64_t check_mask, uint64_t test_mask)
 
template<class C , class ReserveFn >
std::istream & ReadContainerType (std::istream &strm, C *c, ReserveFn reserve)
 
template<typename T , class A , typename std::enable_if_t< std::is_class_v< T >, T > * = nullptr>
std::istream & ReadVectorType (std::istream &strm, std::vector< T, A > *c)
 
template<class C >
std::ostream & WriteSequence (std::ostream &strm, const C &c)
 
template<class C >
std::ostream & WriteContainer (std::ostream &strm, const C &c)
 

Variables

constexpr uint8_t kEncodeHasISymbols = 0x04
 
constexpr uint8_t kEncodeHasOSymbols = 0x08
 
constexpr int32_t kEncodeMagicNumber = 2128178506
 
constexpr uint8_t kPdtInited = 0x01
 
constexpr uint8_t kPdtFinal = 0x02
 
constexpr uint8_t kPdtMarked = 0x04
 
const std::string_view PropertyNames []
 
constexpr size_t kNoArc = -1
 
constexpr int kLineLen = 8096
 

Typedef Documentation

template<typename StackId , typename Level , Level nlevels>
using fst::internal::StackConfig = typedef std::array<StackId, nlevels>

Definition at line 46 of file mpdt.h.

template<typename T >
using fst::internal::type_identity_t = typedef typename type_identity<T>::type

Definition at line 78 of file compat.h.

Function Documentation

template<class Arc >
void fst::internal::AcceptorMinimize ( MutableFst< Arc > *  fst)

Definition at line 463 of file minimize.h.

template<class Arc >
uint64_t fst::internal::CheckProperties ( const Fst< Arc > &  fst,
uint64_t  check_mask,
uint64_t  test_mask 
)

Definition at line 223 of file test-properties.h.

bool fst::internal::CompatProperties ( uint64_t  props1,
uint64_t  props2 
)
inline

Definition at line 506 of file properties.h.

template<class Arc >
uint64_t fst::internal::ComputeOrUseStoredProperties ( const Fst< Arc > &  fst,
uint64_t  mask,
uint64_t *  known 
)

Definition at line 185 of file test-properties.h.

template<class Arc >
uint64_t fst::internal::ComputeProperties ( const Fst< Arc > &  fst,
uint64_t  mask,
uint64_t *  known 
)

Definition at line 48 of file test-properties.h.

template<class Label >
bool fst::internal::ConvertStringToLabels ( std::string_view  str,
TokenType  token_type,
const SymbolTable syms,
Label  unknown_label,
bool  allow_negative,
std::vector< Label > *  labels,
const std::string &  sep = FST_FLAGS_fst_field_separator 
)

Definition at line 92 of file string.h.

template<class Label >
bool fst::internal::ConvertSymbolToLabel ( std::string_view  str,
const SymbolTable syms,
Label  unknown_label,
bool  allow_negative,
Label *  output 
)

Definition at line 65 of file string.h.

template<class Var , class Edge >
bool fst::internal::ExpandLZCode ( const std::vector< std::pair< Var, Edge >> &  code,
std::vector< std::vector< Edge >> *  expanded_code 
)

Definition at line 57 of file compress.h.

template<class Arc >
Arc::Weight fst::internal::Final ( const ExpandedFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 97 of file expanded-fst.h.

template<class Arc >
Arc::Weight fst::internal::Final ( const MutableFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 260 of file mutable-fst.h.

template<class F >
F::Arc::Weight fst::internal::Final ( const F &  fst,
typename F::Arc::StateId  s 
)
inline

Definition at line 615 of file fst.h.

template<class Arc >
Arc::Weight fst::internal::Final ( const Fst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 637 of file fst.h.

template<class Compactor , class Arc >
const Compactor* fst::internal::GetCompactor ( const CompactFst< Arc, Compactor > &  fst)

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

template<class Compactor , class Arc >
const Compactor* fst::internal::GetCompactor ( const Fst< Arc > &  fst)

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

template<class S >
size_t fst::internal::GetResultSize ( const std::vector< S > &  elements,
size_t  s_size 
)

Definition at line 169 of file compat.h.

template<class T >
constexpr bool fst::internal::IsNan ( value)
inline

Definition at line 47 of file float-weight.h.

double fst::internal::KahanLogDiff ( double  a,
double  b,
double *  c 
)
inline

Definition at line 500 of file float-weight.h.

double fst::internal::KahanLogSum ( double  a,
double  b,
double *  c 
)
inline

Definition at line 488 of file float-weight.h.

double fst::internal::KahanRealSum ( double  a,
double  b,
double *  c 
)
inline

Definition at line 718 of file float-weight.h.

int fst::internal::KeySize ( const std::string &  source)

Definition at line 34 of file compile-strings.cc.

uint64_t fst::internal::KnownProperties ( uint64_t  props)
inline

Definition at line 499 of file properties.h.

template<class Label >
bool fst::internal::LabelsToNumericString ( const std::vector< Label > &  labels,
std::string *  str,
std::string_view  sep,
bool  omit_epsilon 
)

Definition at line 153 of file string.h.

template<class Label >
bool fst::internal::LabelsToSymbolString ( const std::vector< Label > &  labels,
std::string *  str,
const SymbolTable syms,
std::string_view  sep,
bool  omit_epsilon 
)

Definition at line 126 of file string.h.

double fst::internal::LogNegExp ( double  x)
inline

Definition at line 479 of file float-weight.h.

double fst::internal::LogPosExp ( double  x)
inline

Definition at line 473 of file float-weight.h.

template<class Arc , class Functor >
void fst::internal::Map ( FarReader< Arc > &  reader,
FarWriter< Arc > &  writer,
Functor  functor 
)

Definition at line 46 of file map-reduce.h.

template<class Arc , class Functor >
bool fst::internal::MapAllReduce ( FarReader< Arc > &  reader1,
FarReader< Arc > &  reader2,
Functor  functor,
std::string_view  begin_key = "",
std::string_view  end_key = "" 
)

Definition at line 68 of file map-reduce.h.

template<class Arc >
void fst::internal::MergeStates ( const Partition< typename Arc::StateId > &  partition,
MutableFst< Arc > *  fst 
)

Definition at line 433 of file minimize.h.

template<class Arc , class RevArc >
void fst::internal::NShortestPath ( const Fst< RevArc > &  ifst,
MutableFst< Arc > *  ofst,
const std::vector< typename Arc::Weight > &  distance,
int32_t  nshortest,
float  delta = kShortestDelta,
typename Arc::Weight  weight_threshold = Arc::Weight::Zero(),
typename Arc::StateId  state_threshold = kNoStateId 
)

Definition at line 312 of file shortest-path.h.

template<class Arc >
ssize_t fst::internal::NumArcs ( const ExpandedFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 103 of file expanded-fst.h.

template<class Arc >
ssize_t fst::internal::NumArcs ( const MutableFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 266 of file mutable-fst.h.

template<class F >
ssize_t fst::internal::NumArcs ( const F &  fst,
typename F::Arc::StateId  s 
)
inline

Definition at line 620 of file fst.h.

template<class Arc >
size_t fst::internal::NumArcs ( const Fst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 643 of file fst.h.

template<class Arc >
ssize_t fst::internal::NumInputEpsilons ( const ExpandedFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 108 of file expanded-fst.h.

template<class Arc >
ssize_t fst::internal::NumInputEpsilons ( const MutableFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

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

template<class F >
ssize_t fst::internal::NumInputEpsilons ( const F &  fst,
typename F::Arc::StateId  s 
)
inline

Definition at line 625 of file fst.h.

template<class Arc >
size_t fst::internal::NumInputEpsilons ( const Fst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 648 of file fst.h.

template<class Arc >
ssize_t fst::internal::NumOutputEpsilons ( const ExpandedFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 114 of file expanded-fst.h.

template<class Arc >
ssize_t fst::internal::NumOutputEpsilons ( const MutableFst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 277 of file mutable-fst.h.

template<class F >
ssize_t fst::internal::NumOutputEpsilons ( const F &  fst,
typename F::Arc::StateId  s 
)
inline

Definition at line 630 of file fst.h.

template<class Arc >
size_t fst::internal::NumOutputEpsilons ( const Fst< Arc > &  fst,
typename Arc::StateId  s 
)
inline

Definition at line 653 of file fst.h.

template<class C , class ReserveFn >
std::istream& fst::internal::ReadContainerType ( std::istream &  strm,
C *  c,
ReserveFn  reserve 
)

Definition at line 125 of file util.h.

template<typename T , class A , typename std::enable_if_t< std::is_class_v< T >, T > * = nullptr>
std::istream & fst::internal::ReadVectorType ( std::istream &  strm,
std::vector< T, A > *  c 
)
inline

Definition at line 142 of file util.h.

template<class Arc , class Queue , class ArcFilter >
bool fst::internal::SingleShortestPath ( const Fst< Arc > &  ifst,
std::vector< typename Arc::Weight > *  distance,
const ShortestPathOptions< Arc, Queue, ArcFilter > &  opts,
typename Arc::StateId *  f_parent,
std::vector< std::pair< typename Arc::StateId, size_t >> *  parent 
)

Definition at line 162 of file shortest-path.h.

template<class Arc >
void fst::internal::SingleShortestPathBacktrace ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
const std::vector< std::pair< typename Arc::StateId, size_t >> &  parent,
typename Arc::StateId  f_parent 
)

Definition at line 86 of file shortest-path.h.

template<class Arc >
uint64_t fst::internal::TestProperties ( const Fst< Arc > &  fst,
uint64_t  mask,
uint64_t *  known 
)

Definition at line 204 of file test-properties.h.

template<class Weight , typename std::enable_if_t< IsIdempotent< Weight >::value > * = nullptr>
bool fst::internal::WeightCompare ( const Weight &  w1,
const Weight &  w2,
float  delta,
bool *  error 
)

Definition at line 42 of file isomorphic.h.

template<class C >
std::ostream& fst::internal::WriteContainer ( std::ostream &  strm,
const C &  c 
)

Definition at line 268 of file util.h.

template<class C >
std::ostream& fst::internal::WriteSequence ( std::ostream &  strm,
const C &  c 
)

Definition at line 260 of file util.h.

Variable Documentation

constexpr uint8_t fst::internal::kEncodeHasISymbols = 0x04
inline

Definition at line 51 of file encode.h.

constexpr uint8_t fst::internal::kEncodeHasOSymbols = 0x08
inline

Definition at line 52 of file encode.h.

constexpr int32_t fst::internal::kEncodeMagicNumber = 2128178506
inline

Definition at line 55 of file encode.h.

constexpr int fst::internal::kLineLen = 8096
inline

Definition at line 63 of file symbol-table.h.

constexpr size_t fst::internal::kNoArc = -1
inline

Definition at line 78 of file shortest-path.h.

constexpr uint8_t fst::internal::kPdtFinal = 0x02
inline

Definition at line 52 of file shortest-path.h.

constexpr uint8_t fst::internal::kPdtInited = 0x01
inline

Definition at line 51 of file shortest-path.h.

constexpr uint8_t fst::internal::kPdtMarked = 0x04
inline

Definition at line 53 of file shortest-path.h.

const std::string_view fst::internal::PropertyNames
Initial value:
= {
"expanded", "mutable", "error", "", "", "", "", "", "", "", "", "", "", "",
"", "",
"acceptor", "not acceptor", "input deterministic",
"non input deterministic", "output deterministic",
"non output deterministic", "input/output epsilons",
"no input/output epsilons", "input epsilons", "no input epsilons",
"output epsilons", "no output epsilons", "input label sorted",
"not input label sorted", "output label sorted", "not output label sorted",
"weighted", "unweighted", "cyclic", "acyclic", "cyclic at initial state",
"acyclic at initial state", "top sorted", "not top sorted", "accessible",
"not accessible", "coaccessible", "not coaccessible", "string",
"not string", "weighted cycles", "unweighted cycles"}

Definition at line 430 of file properties.cc.