Namespaces | Classes | Enumerations | Functions | Variables

fst Namespace Reference

For optional argument declarations. More...

Namespaces

namespace  internal
 

FST accessors, useful in high-performance applications.


namespace  script

Classes

class  DefaultAccumulator
 This class accumulates arc weights using the semiring Plus(). More...
class  LogAccumulator
class  FastLogAccumulatorData
class  MutableFastLogAccumulatorData
class  FastLogAccumulator
class  CacheLogAccumulatorData
class  CacheLogAccumulator
class  ReplaceAccumulatorData
 Stores shareable data for replace accumulator copies. More...
class  ReplaceAccumulator
class  SafeReplaceAccumulator
class  NullAddOn
 Nothing to save. More...
class  AddOnPair
 Create a new add-on from a pair of add-ons. More...
class  ArcArena
class  ArcArenaStateStore
struct  ArcMapFstOptions
class  ArcMapFst
 namespace internal More...
class  StateIterator< ArcMapFst< A, B, C > >
class  ArcIterator< ArcMapFst< A, B, C > >
 Specialization for ArcMapFst. More...
class  IdentityArcMapper
 Utility Mappers. More...
class  InputEpsilonMapper
 Mapper that converts all input symbols to epsilon. More...
class  OutputEpsilonMapper
 Mapper that converts all output symbols to epsilon. More...
class  SuperFinalMapper
class  WeightConvertMapper
class  ToGallicMapper
 Mapper from A to GallicArc. More...
class  FromGallicMapper
 Mapper from GallicArc to A. More...
class  GallicToNewSymbolsMapper
 Mapper from GallicArc to A. More...
class  PlusMapper
 Mapper to add a constant to all weights. More...
class  TimesMapper
 Mapper to (right) multiply a constant to all weights. More...
class  PowerMapper
 Mapper to take all arc-weights to a fixed power. More...
class  InvertWeightMapper
 Mapper to reciprocate all non-Zero() weights. More...
class  RmWeightMapper
 Mapper to map all non-Zero() weights to One(). More...
class  QuantizeMapper
 Mapper to quantize all weights. More...
class  ReverseWeightMapper
struct  ArcTpl
struct  StringArc
 Arc with integer labels and state IDs and string weights. More...
struct  GallicArc
struct  ReverseArc
 Arc with the reverse of the weight found in its template arg. More...
struct  LexicographicArc
 Arc with integer labels and state IDs and lexicographic weights. More...
struct  ProductArc
 Arc with integer labels and state IDs and product weights. More...
struct  PowerArc
struct  SparsePowerArc
struct  ExpectationArc
class  AnyArcFilter
 True for all arcs. More...
class  EpsilonArcFilter
 True for (input/output) epsilon arcs. More...
class  InputEpsilonArcFilter
 True for input epsilon arcs. More...
class  OutputEpsilonArcFilter
 True for output epsilon arcs. More...
class  LabelArcFilter
class  MultiLabelArcFilter
 True if specified labels match (don't match) when keep_match is true (false). More...
class  ArcSortMapper
class  ArcSortFst
class  StateIterator< ArcSortFst< Arc, Compare > >
 Specialization for ArcSortFst. More...
class  ArcIterator< ArcSortFst< Arc, Compare > >
 Specialization for ArcSortFst. More...
class  ILabelCompare
 Compare class for comparing input labels of arcs. More...
class  OLabelCompare
 Compare class for comparing output labels of arcs. More...
class  HashBiTable
struct  HashSet
 Default hash set is STL hash_set. More...
class  CompactHashBiTable
class  VectorBiTable
class  VectorHashBiTable
class  ErasableBiTable
struct  CacheOptions
 Options for controlling caching behavior; higher level than CacheImplOptions. More...
struct  CacheImplOptions
class  CacheState
 Cache state, with arcs stored in a per-state std::vector. More...
class  VectorCacheStore
 Container cache stores. More...
class  HashCacheStore
 This class uses a hash map from state IDs to pointers to cached states. More...
class  FirstCacheStore
 Garbage-colllection cache stores. More...
class  GCCacheStore
class  DefaultCacheStore
class  CacheStateIterator
 namespace internal More...
class  CacheArcIterator
class  CacheMutableArcIterator
class  ExpanderCacheStore
 Wrap existing CacheStore implementation to use with ExpanderFst. More...
struct  ClosureFstOptions
class  ClosureFst
class  StateIterator< ClosureFst< Arc > >
 Specialization for ClosureFst. More...
class  ArcIterator< ClosureFst< Arc > >
 Specialization for ClosureFst. More...
struct  CompactFstOptions
class  DefaultCompactStore
class  DefaultCompactor
 Wraps an arc compactor and a compact store as a new Fst compactor. More...
class  DefaultCompactState
class  DefaultCompactState< C, U, DefaultCompactStore< typename C::Element, U > >
 Specialization for DefaultCompactStore. More...
class  CompactFst
 namespace internal More...
class  StateIterator< CompactFst< Arc, ArcCompactor, Unsigned, CompactStore, CacheStore > >
class  ArcIterator< CompactFst< Arc, ArcCompactor, Unsigned, CompactStore, CacheStore > >
class  StringCompactor
 ArcCompactor for unweighted string FSTs. More...
class  WeightedStringCompactor
 ArcCompactor for weighted string FSTs. More...
class  UnweightedAcceptorCompactor
 ArcCompactor for unweighted acceptor FSTs. More...
class  AcceptorCompactor
 ArcCompactor for weighted acceptor FSTs. More...
class  UnweightedCompactor
 ArcCompactor for unweighted FSTs. More...
class  CheckSummer
 Check sums. More...
class  ComplementFst
 namespace internal More...
class  StateIterator< ComplementFst< Arc > >
 Specialization for ComplementFst. More...
class  ArcIterator< ComplementFst< Arc > >
 Specialization for ComplementFst. More...
class  NullComposeFilter
class  TrivialComposeFilter
class  SequenceComposeFilter
 This filter requires epsilons on FST1 to be read before epsilons on FST2. More...
class  AltSequenceComposeFilter
 This filter requires epsilons on FST2 to be read before epsilons on FST1. More...
class  MatchComposeFilter
class  MultiEpsFilter
struct  ComposeFstOptions
struct  ComposeFstImplOptions
class  ComposeFst
 namespace internal More...
class  StateIterator< ComposeFst< Arc, CacheStore > >
 Specialization for ComposeFst. More...
class  ArcIterator< ComposeFst< Arc, CacheStore > >
 Specialization for ComposeFst. More...
class  ComposeFstMatcher
struct  ComposeOptions
class  ConcatFst
class  StateIterator< ConcatFst< Arc > >
 Specialization for ConcatFst. More...
class  ArcIterator< ConcatFst< Arc > >
 Specialization for ConcatFst. More...
class  CcVisitor
 Finds and returns connected components. Use with Visit(). More...
class  SccVisitor
class  ConstFst
 namespace internal More...
class  StateIterator< ConstFst< Arc, Unsigned > >
class  ArcIterator< ConstFst< Arc, Unsigned > >
struct  DefaultCommonDivisor
 The default common divisor uses the semiring Plus. More...
struct  LabelCommonDivisor
class  GallicCommonDivisor
class  GallicCommonDivisor< Label, W, GALLIC, CommonDivisor >
 Specialization for general GALLIC weight. More...
class  DefaultDeterminizeFilter
 namespace internal More...
class  DefaultDeterminizeStateTable
 The default determinization state table based on the compact hash bi-table. More...
struct  DeterminizeFstOptions
class  DeterminizeFst
 namespace internal More...
class  StateIterator< DeterminizeFst< Arc > >
 namespace internal More...
class  ArcIterator< DeterminizeFst< Arc > >
 Specialization for DeterminizeFst. More...
struct  DeterminizeOptions
struct  DifferenceFstOptions
class  DifferenceFst
class  StateIterator< DifferenceFst< Arc > >
 Specialization for DifferenceFst. More...
class  ArcIterator< DifferenceFst< Arc > >
 Specialization for DifferenceFst. More...
struct  DisambiguateOptions
class  EditFst
 namespace internal More...
class  EncodeMapper
 namespace internal More...
class  EncodeFst
class  DecodeFst
class  StateIterator< EncodeFst< Arc > >
 Specialization for EncodeFst. More...
class  ArcIterator< EncodeFst< Arc > >
 Specialization for EncodeFst. More...
class  StateIterator< DecodeFst< Arc > >
 Specialization for DecodeFst. More...
class  ArcIterator< DecodeFst< Arc > >
 Specialization for DecodeFst. More...
class  ExpandedFst
 A generic FST plus state count. More...
class  ImplToExpandedFst
class  ExpectationWeight
class  WeightGenerate< ExpectationWeight< X1, X2 > >
class  LempelZiv
 namespace internal More...
class  Compressor
 The main Compressor class. More...
class  Elias
class  GzFile
class  OGzFile
 Resource handle for writing stringstream to GzFile. More...
class  IGzFile
 Resource handle for reading stringstream from GzFile. More...
class  RandMod
class  StringReader
class  FarHeader
 FST archive header class. More...
class  FarWriter
 This class creates an archive of FSTs. More...
class  FarReader
 This class iterates through an existing archive of FSTs. More...
class  FstWriter
class  STTableFarWriter
class  STListFarWriter
class  FstFarWriter
class  FstReader
class  STTableFarReader
class  STListFarReader
class  FstFarReader
struct  KeyInfo
struct  FarInfoData
class  STListWriter
class  STListReader
class  STTableWriter
class  STTableReader
class  LinearFstDataBuilder
class  LinearClassifierFstDataBuilder
class  FeatureGroupBuilder
class  LinearFstData
class  FeatureGroup
class  LinearTaggerFst
 namespace internal More...
class  StateIterator< LinearTaggerFst< Arc > >
 Specialization for LinearTaggerFst. More...
class  ArcIterator< LinearTaggerFst< Arc > >
 Specialization for LinearTaggerFst. More...
class  LinearClassifierFst
 namespace internal More...
class  StateIterator< LinearClassifierFst< Arc > >
 Specialization for LinearClassifierFst. More...
class  ArcIterator< LinearClassifierFst< Arc > >
 Specialization for LinearClassifierFst. More...
class  LinearFstMatcherTpl
struct  ParentLabel
 A pair of parent node id and label, part of a trie edge. More...
struct  ParentLabelHash
class  NestedTrieTopology
class  FlatTrieTopology
class  MutableTrie
class  MPdtParenFilter
class  MPdtComposeFstOptions
class  MPdtComposeFstOptions< Arc, false >
struct  MPdtComposeOptions
struct  MPdtExpandFstOptions
class  MPdtExpandFst
 namespace internal More...
class  StateIterator< MPdtExpandFst< Arc > >
 Specialization for MPdtExpandFst. More...
class  ArcIterator< MPdtExpandFst< Arc > >
 Specialization for MPdtExpandFst. More...
struct  MPdtExpandOptions
class  MPdtInfo
 Compute various information about MPDTs, helper class for mpdtinfo.cc. More...
class  BitmapIndex
struct  NGramFstInst
class  NGramFst
 namespace internal More...
class  NGramFstMatcher
 namespace internal More...
class  StateIterator< NGramFst< A > >
 Specialization for NGramFst; see generic version in fst.h for sample usage (but use the ProdLmFst type!). This version / should inline. More...
class  ArcIterator< NGramFst< A > >
class  Collection
class  ParenMatcher
class  ParenFilter
class  PdtComposeFstOptions
class  PdtComposeFstOptions< Arc, false >
struct  PdtComposeOptions
struct  PdtExpandFstOptions
class  PdtExpandFst
 namespace internal More...
class  StateIterator< PdtExpandFst< Arc > >
 Specialization for PdtExpandFst. More...
class  ArcIterator< PdtExpandFst< Arc > >
 Specialization for PdtExpandFst. More...
class  PdtPrunedExpand
struct  PdtExpandOptions
 Expand functions. More...
class  PdtInfo
 Compute various information about PDTs. More...
class  PdtStack
struct  PdtStateTuple
 State tuple for PDT expansion. More...
class  PdtStateHash
 Hash function object for PDT state tuples. More...
class  PdtStateTable
 Tuple to PDT state bijection. More...
struct  PdtReplaceOptions
class  PdtParser
 PdtParser: Base PDT parser class common to specific parsers. More...
class  final
 Last-in, first-out queue discipline. More...
struct  PdtShortestPathOptions
class  PdtShortestPath
 namespace internal More...
class  PhiFstMatcher
class  RhoFstMatcher
class  SigmaFstMatcher
struct  FactorWeightOptions
class  IdentityFactor
 Factors trivially. More...
class  StringFactor
 Factors a StringWeight w as 'ab' where 'a' is a label. More...
class  GallicFactor
 Factor a GallicWeight using StringFactor. More...
class  GallicFactor< Label, W, GALLIC >
 Specialization for the (general) GALLIC type GallicWeight. More...
class  FactorWeightFst
 namespace internal More...
class  StateIterator< FactorWeightFst< Arc, FactorIterator > >
 Specialization for FactorWeightFst. More...
class  ArcIterator< FactorWeightFst< Arc, FactorIterator > >
 Specialization for FactorWeightFst. More...
class  IntegerFilterState
 Filter state that is a signed integral type. More...
class  WeightFilterState
 Filter state that is a weight (class). More...
class  ListFilterState
class  PairFilterState
 Filter state that is the combination of two filter states. More...
class  TrivialFilterState
 Single non-blocking filter state. More...
class  FloatLimits
 Numeric limits class. More...
class  FloatWeightTpl
 Weight class to be templated on floating-points types. More...
class  TropicalWeightTpl
 Tropical semiring: (min, +, inf, 0). More...
class  LogWeightTpl
 Log semiring: (log(e^-x + e^-y), +, inf, 0). More...
class  Adder< LogWeightTpl< T > >
 Specialization using the Kahan compensated summation. More...
class  MinMaxWeightTpl
 MinMax semiring: (min, max, inf, -inf). More...
struct  WeightConvert< LogWeight, TropicalWeight >
 Converts to tropical. More...
struct  WeightConvert< Log64Weight, TropicalWeight >
struct  WeightConvert< TropicalWeight, LogWeight >
 Converts to log. More...
struct  WeightConvert< Log64Weight, LogWeight >
struct  WeightConvert< TropicalWeight, Log64Weight >
 Converts to log64. More...
struct  WeightConvert< LogWeight, Log64Weight >
class  FloatWeightGenerate
class  WeightGenerate< TropicalWeightTpl< T > >
class  WeightGenerate< LogWeightTpl< T > >
class  WeightGenerate< MinMaxWeightTpl< T > >
struct  FstReadOptions
struct  FstWriteOptions
class  FstHeader
class  Fst
class  StateIteratorBase
struct  StateIteratorData
 StateIterator initialization data. More...
class  StateIterator
class  ArcIteratorBase
struct  ArcIteratorData
 ArcIterator initialization data. More...
class  ArcIterator
class  ImplToFst
class  GenericRegister
class  GenericRegisterer
class  Heap
struct  IntersectFstOptions
class  IntersectFst
class  StateIterator< IntersectFst< Arc > >
 Specialization for IntersectFst. More...
class  ArcIterator< IntersectFst< Arc > >
 Specialization for IntersectFst. More...
struct  IntInterval
 Half-open integral interval [a, b) of signed integers of type T. More...
class  VectorIntervalStore
class  IntervalSet
struct  InvertMapper
 Mapper to implement inversion of an arc. More...
class  InvertFst
class  StateIterator< InvertFst< Arc > >
 Specialization for InvertFst. More...
class  ArcIterator< InvertFst< Arc > >
 Specialization for InvertFst. More...
class  LabelReachableData
 Stores shareable data for label reachable class copies. More...
class  LabelReachable
class  LexicographicWeight
class  WeightGenerate< LexicographicWeight< W1, W2 > >
class  Mutex
class  MutexLock
class  LookAheadSelector
class  LookAheadSelector< Matcher, Matcher, MT >
class  LookAheadSelector< Matcher1, Matcher2, MATCH_INPUT >
class  LookAheadSelector< Matcher1, Matcher2, MATCH_OUTPUT >
class  LookAheadComposeFilter
class  PushWeightsComposeFilter
class  PushLabelsComposeFilter
class  DefaultLookAhead
class  DefaultLookAhead< Arc, MATCH_INPUT >
 Specializes for MATCH_INPUT to allow lookahead. More...
class  DefaultLookAhead< Arc, MATCH_OUTPUT >
 Specializes for MATCH_OUTPUT to allow lookahead. More...
class  DefaultLookAhead< StdArc, MATCH_INPUT >
 Specializes for StdArc to allow weight and label pushing. More...
class  DefaultLookAhead< StdArc, MATCH_OUTPUT >
 Specializes for StdArc to allow weight and label pushing. More...
class  DefaultLookAhead< LogArc, MATCH_INPUT >
 Specializes for LogArc to allow weight and label pushing. More...
class  DefaultLookAhead< LogArc, MATCH_OUTPUT >
 Specializes for LogArc to allow weight and label pushing. More...
class  LookAheadMatcherBase
class  TrivialLookAheadMatcher
 Doesn't actually lookahead, just declares that the future looks good. More...
class  ArcLookAheadMatcher
class  LabelLookAheadMatcher
class  LabelLookAheadRelabeler
 Label-lookahead relabeling class. More...
class  LookAheadMatcher
class  MapFst
class  StateIterator< MapFst< A, B, C > >
 Specialization for MapFst. More...
class  ArcIterator< MapFst< A, B, C > >
 Specialization for MapFst. More...
struct  IdentityMapper
 For backwards compatibility only; use IdentityArcMapper otherwise. More...
struct  MemoryRegion
class  MappedFile
class  NullMatcherFstInit
 Trivial (no-op) MatcherFst initializer functor. More...
class  MatcherFst
class  StateIterator< MatcherFst< FST, M, Name, Init > >
 Specialization for MatcherFst. More...
class  ArcIterator< MatcherFst< FST, M, Name, Init > >
 Specialization for MatcherFst. More...
class  Matcher< MatcherFst< F, M, Name, Init > >
 Specialization for MatcherFst. More...
class  LookAheadMatcher< MatcherFst< F, M, Name, Init > >
 Specialization for MatcherFst. More...
class  MatcherBase
class  SortedMatcher
class  HashMatcher
class  PhiMatcher
class  RhoMatcher
class  SigmaMatcher
class  MultiEpsMatcher
class  ExplicitMatcher
class  Matcher
class  MemoryArenaBase
class  MemoryArena
class  MemoryPoolBase
class  MemoryPool
class  MemoryArenaCollection
 Stores a collection of memory arenas. More...
class  MemoryPoolCollection
 Stores a collection of memory pools. More...
class  BlockAllocator
class  PoolAllocator
class  MutableFst
class  MutableArcIteratorBase
struct  MutableArcIteratorData
class  MutableArcIterator
class  ImplToMutableFst
class  PairWeight
class  WeightGenerate< PairWeight< W1, W2 > >
class  PowerWeight
class  WeightGenerate< PowerWeight< W, n > >
class  ProductWeight
 Product semiring: W1 * W2. More...
class  WeightGenerate< ProductWeight< W1, W2 > >
class  ProjectMapper
 Mapper to implement projection per arc. More...
class  ProjectFst
class  StateIterator< ProjectFst< A > >
 Specialization for ProjectFst. More...
class  ArcIterator< ProjectFst< A > >
 Specialization for ProjectFst. More...
struct  PruneOptions
 namespace internal More...
class  QueueBase
class  FifoQueue
class  ShortestFirstQueue
struct  TrivialAStarEstimate
 The trivial A* estimate is always One(). More...
class  AStarWeightCompare
struct  TrivialStateEquivClass
class  PruneQueue
class  UniformArcSelector
class  LogProbArcSelector
class  FastLogProbArcSelector
struct  RandState
 Random path state info maintained by RandGenFst and passed to samplers. More...
class  ArcSampler
class  ArcSampler< Arc, FastLogProbArcSelector< Arc > >
 Specialization for FastLogProbArcSelector. More...
struct  RandGenFstOptions
class  RandGenFst
 namespace internal More...
class  StateIterator< RandGenFst< FromArc, ToArc, Sampler > >
 Specialization for RandGenFst. More...
class  ArcIterator< RandGenFst< FromArc, ToArc, Sampler > >
 Specialization for RandGenFst. More...
struct  RandGenOptions
 Options for random path generation. More...
class  RationalFst
 namespace internal More...
class  StateIterator< RationalFst< Arc > >
 Specialization for RationalFst. More...
class  ArcIterator< RationalFst< Arc > >
 Specialization for RationalFst. More...
struct  FstRegisterEntry
 This class represents a single entry in a FstRegister. More...
class  FstRegister
class  FstRegisterer
class  RelabelFst
 namespace internal More...
class  StateIterator< RelabelFst< Arc > >
 Specialization for RelabelFst. More...
class  ArcIterator< RelabelFst< Arc > >
 Specialization for RelabelFst. More...
struct  ReplaceUtilOptions
class  ReplaceUtil
struct  ReplaceStateTuple
 Tuple that uniquely defines a state in replace. More...
class  ReplaceRootSelector
 Functor returning true for tuples corresponding to states in the root FST. More...
class  ReplaceFingerprint
 Functor for fingerprinting replace state tuples. More...
class  ReplaceFstStateFingerprint
 Useful when the fst_state uniquely define the tuple. More...
class  ReplaceHash
 A generic hash function for replace state tuples. More...
class  ReplaceStackPrefix
 Container for stack prefix. More...
class  ReplaceStackPrefixHash
 Hash function for stack prefix to prefix id. More...
class  VectorHashReplaceStateTable
 Replace state tables. More...
class  DefaultReplaceStateTable
 Default replace state table. More...
struct  ReplaceFstOptions
class  ReplaceFst
 namespace internal More...
class  StateIterator< ReplaceFst< Arc, StateTable, CacheStore > >
 Specialization for ReplaceFst. More...
class  ArcIterator< ReplaceFst< Arc, StateTable, CacheStore > >
class  ReplaceFstMatcher
class  RmEpsilonOptions
struct  RmEpsilonFstOptions
class  RmEpsilonFst
 namespace internal More...
class  StateIterator< RmEpsilonFst< Arc > >
 Specialization for RmEpsilonFst. More...
class  ArcIterator< RmEpsilonFst< Arc > >
 Specialization for RmEpsilonFst. More...
class  FstCompiler
class  FstDrawer
class  FstInfo
class  FstPrinter
class  SetWeight
 Set semiring of integral labels. More...
class  SetWeightIterator
 Traverses set in forward direction. More...
struct  WeightConvert< SetWeight< Label, S1 >, SetWeight< Label, S2 > >
 Converts between different set types. More...
class  WeightGenerate< SetWeight< Label, S > >
struct  ShortestDistanceOptions
struct  ShortestPathOptions
class  SignedLogWeightTpl
class  Adder< SignedLogWeightTpl< T > >
 Specialization using the Kahan compensated summation. More...
struct  WeightConvert< SignedLogWeight, TropicalWeight >
 Converts to tropical. More...
struct  WeightConvert< SignedLog64Weight, TropicalWeight >
struct  WeightConvert< SignedLogWeight, LogWeight >
 Converts to log. More...
struct  WeightConvert< SignedLog64Weight, LogWeight >
struct  WeightConvert< SignedLogWeight, Log64Weight >
 Converts to log64. More...
struct  WeightConvert< SignedLog64Weight, Log64Weight >
struct  WeightConvert< TropicalWeight, SignedLogWeight >
 Converts to signed log. More...
struct  WeightConvert< LogWeight, SignedLogWeight >
struct  WeightConvert< Log64Weight, SignedLogWeight >
struct  WeightConvert< SignedLog64Weight, SignedLogWeight >
struct  WeightConvert< TropicalWeight, SignedLog64Weight >
 Converts to signed log64. More...
struct  WeightConvert< LogWeight, SignedLog64Weight >
struct  WeightConvert< Log64Weight, SignedLog64Weight >
struct  WeightConvert< SignedLogWeight, SignedLog64Weight >
class  WeightGenerate< SignedLogWeightTpl< T > >
struct  SparseTupleWeightPlusMapper
struct  SparseTupleWeightTimesMapper
struct  SparseTupleWeightDivideMapper
struct  SparseTupleWeightApproxMapper
class  SparsePowerWeight
class  WeightGenerate< SparsePowerWeight< W, K > >
class  SparseTupleWeight
class  SparseTupleWeightIterator
class  StateMapStateIteratorBase
 Facade around StateIteratorBase inheriting from StateIteratorBase. More...
class  StateMapFst
 namespace internal More...
class  ArcIterator< StateMapFst< A, B, C > >
 Specialization for StateMapFst. More...
class  IdentityStateMapper
 Utility mappers. More...
class  ArcSumMapper
class  ArcUniqueMapper
class  IntervalReachVisitor
class  StateReachable
class  HashStateTable
class  CompactHashStateTable
class  VectorStateTable
class  VectorHashStateTable
class  ErasableStateTable
class  DefaultComposeStateTuple
class  DefaultComposeStateTuple< S, TrivialFilterState >
class  ComposeHash
 Hashing of composition state tuples. More...
class  GenericComposeStateTable
 A HashStateTable over composition tuples. More...
class  ComposeFingerprint
 Fingerprint for general composition tuples. More...
class  ComposeState1Fingerprint
 Useful when the first composition state determines the tuple. More...
class  ComposeState2Fingerprint
 Useful when the second composition state determines the tuple. More...
class  ProductComposeStateTable
class  StringDetComposeStateTable
class  DetStringComposeStateTable
class  ErasableComposeStateTable
class  StringWeight
 String semiring: (longest_common_prefix/suffix, ., Infinity, Epsilon). More...
class  StringWeightIterator
 Traverses string in forward direction. More...
class  StringWeightReverseIterator
 Traverses string in backward direction. More...
class  WeightGenerate< StringWeight< Label, S > >
struct  GallicWeight
 Product of string weight and an arbitraryy weight. More...
class  WeightGenerate< GallicWeight< Label, W, G > >
struct  GallicUnionWeightOptions
 Union weight options for (general) GALLIC type. More...
struct  GallicWeight< Label, W, GALLIC >
 Specialization for the (general) GALLIC type. More...
class  WeightGenerate< GallicWeight< Label, W, GALLIC > >
class  StringCompiler
 namespace internal More...
class  StringPrinter
 Functor for printing a string FST as a string. More...
struct  SymbolTableReadOptions
struct  SymbolTableTextOptions
class  SymbolTable
 namespace internal More...
class  SymbolTableIterator
 Iterator class for symbols in a symbol table. More...
class  SynchronizeFst
 namespace internal More...
class  StateIterator< SynchronizeFst< Arc > >
 Specialization for SynchronizeFst. More...
class  ArcIterator< SynchronizeFst< Arc > >
 Specialization for SynchronizeFst. More...
class  TopOrderVisitor
 DFS visitor class to return topological ordering. More...
class  TupleWeight
 n-tuple weight, element of the n-th Cartesian power of W. More...
class  UnionFind
 Union-Find algorithm for dense sets of non-negative integers. More...
class  UnionWeight
class  UnionWeightIterator
 Traverses union weight in the forward direction. More...
class  UnionWeightReverseIterator
 Traverses union weight in backward direction. More...
class  WeightGenerate< UnionWeight< W, O > >
class  UnionFst
class  StateIterator< UnionFst< Arc > >
 Specialization for UnionFst. More...
class  ArcIterator< UnionFst< Arc > >
 Specialization for UnionFst. More...
class  CompactSet
class  VectorState
class  VectorFst
 namespace internal More...
class  StateIterator< VectorFst< Arc, State > >
class  ArcIterator< VectorFst< Arc, State > >
class  MutableArcIterator< VectorFst< Arc, State > >
class  CopyVisitor
 Copies input FST to mutable FST following queue order. More...
class  PartialVisitor
 Visits input FST up to a state limit following queue order. More...
class  PartialCopyVisitor
 Copies input FST to mutable FST up to a state limit following queue order. More...
class  NaturalLess
class  Adder
 Simple default adder class. Specializations might be more complex. More...
struct  WeightConvert
 General weight converter: raises error. More...
struct  WeightConvert< W, W >
 Specialized weight converter to self. More...
struct  WeightGenerate
 General random weight generator: raises error. More...
class  CompositeWeightWriter
 namespace internal More...
class  CompositeWeightReader
class  EpsMapper
class  WeightedTester
class  UnweightedTester
class  UnweightedTester< StdArc >
class  AlgoTester
class  FstTester
class  WeightTester

Enumerations

enum  MapFinalAction { MAP_NO_SUPERFINAL, MAP_ALLOW_SUPERFINAL, MAP_REQUIRE_SUPERFINAL }
 

Determines how final weights are mapped.

More...
enum  MapSymbolsAction { MAP_CLEAR_SYMBOLS, MAP_COPY_SYMBOLS, MAP_NOOP_SYMBOLS }
 

Determines how symbol tables are mapped.

More...
enum  HSType { HS_STL = 0, HS_DENSE = 1, HS_SPARSE = 2, HS_FLAT = 3 }
 

Enables alternative hash set representations below.

More...
enum  ComposeFilter {
  AUTO_FILTER, NULL_FILTER, TRIVIAL_FILTER, SEQUENCE_FILTER,
  ALT_SEQUENCE_FILTER, MATCH_FILTER
}
enum  DeterminizeType { DETERMINIZE_FUNCTIONAL, DETERMINIZE_NONFUNCTIONAL, DETERMINIZE_DISAMBIGUATE }
 

Determinization type.

More...
enum  EncodeType { ENCODE = 1, DECODE = 2 }
enum  EpsNormalizeType { EPS_NORM_INPUT, EPS_NORM_OUTPUT }
enum  FarEntryType { FET_LINE, FET_FILE }
enum  FarTokenType { FTT_SYMBOL, FTT_BYTE, FTT_UTF8 }
enum  FarType { FAR_DEFAULT = 0, FAR_STTABLE = 1, FAR_STLIST = 2, FAR_FST = 3 }
enum  MPdtType { MPDT_READ_RESTRICT, MPDT_WRITE_RESTRICT, MPDT_NO_RESTRICT }
enum  PdtComposeFilter { PAREN_FILTER, EXPAND_FILTER, EXPAND_PAREN_FILTER }
enum  PdtParserType { PDT_LEFT_PARSER, PDT_LEFT_SR_PARSER }
 

namespace internal

More...
enum  MatchType {
  MATCH_INPUT = 1, MATCH_OUTPUT = 2, MATCH_BOTH = 3, MATCH_NONE = 4,
  MATCH_UNKNOWN = 5
}
 

Specifies matcher action.

More...
enum  MatcherRewriteMode { MATCHER_REWRITE_AUTO = 0, MATCHER_REWRITE_ALWAYS, MATCHER_REWRITE_NEVER }
 

Specifies whether we rewrite both the input and output sides during matching.

More...
enum  ProjectType { PROJECT_INPUT = 1, PROJECT_OUTPUT = 2 }
 

This specifies whether to project on input or output.

More...
enum  QueueType {
  TRIVIAL_QUEUE = 0, FIFO_QUEUE = 1, LIFO_QUEUE = 2, SHORTEST_FIRST_QUEUE = 3,
  TOP_ORDER_QUEUE = 4, STATE_ORDER_QUEUE = 5, SCC_QUEUE = 6, AUTO_QUEUE = 7,
  OTHER_QUEUE = 8
}
 

State queue types.

More...
enum  ClosureType { CLOSURE_STAR = 0, CLOSURE_PLUS = 1 }
 

This specifies whether to add the empty string.

More...
enum  ReplaceLabelType { REPLACE_LABEL_NEITHER = 1, REPLACE_LABEL_INPUT = 2, REPLACE_LABEL_OUTPUT = 3, REPLACE_LABEL_BOTH = 4 }
enum  ReweightType { REWEIGHT_TO_INITIAL, REWEIGHT_TO_FINAL }
enum  SetType { SET_INTERSECT_UNION = 0, SET_UNION_INTERSECT = 1, SET_INTERSECT_UNION_RESTRICT = 2, SET_BOOLEAN = 3 }
enum  StringType { STRING_LEFT = 0, STRING_RIGHT = 1, STRING_RESTRICT = 2 }
enum  GallicType {
  GALLIC_LEFT = 0, GALLIC_RIGHT = 1, GALLIC_RESTRICT = 2, GALLIC_MIN = 3,
  GALLIC = 4
}
enum  StringTokenType { SYMBOL = 1, BYTE = 2, UTF8 = 3 }
enum  DivideType { DIVIDE_LEFT, DIVIDE_RIGHT, DIVIDE_ANY }
 

Determines direction of division.

More...

Functions

string GetFarTypeString (FarType type)
 namespace script
bool IsSTList (const string &filename)
int KeySize (const char *filename)
bool IsSTTable (const string &filename)
template<class A , class C >
void ArcMap (MutableFst< A > *fst, C *mapper)
template<class A , class C >
void ArcMap (MutableFst< A > *fst, C mapper)
template<class A , class B , class C >
void ArcMap (const Fst< A > &ifst, MutableFst< B > *ofst, C *mapper)
template<class A , class B , class C >
void ArcMap (const Fst< A > &ifst, MutableFst< B > *ofst, C mapper)
template<class Arc , class Compare >
void ArcSort (MutableFst< Arc > *fst, Compare comp)
template<class Arc >
void Closure (MutableFst< Arc > *fst, ClosureType closure_type)
template<class Arc >
void Closure (RationalFst< Arc > *fst, ClosureType closure_type)
template<class F , class G >
void Cast (const F &, G *)
template<typename To , typename From >
To down_cast (From *f)
 Downcasting.
template<class Dest , class Source >
Dest bit_cast (const Source &source)
 Bitcasting.
template<class Arc >
void Compose (const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const ComposeOptions &opts=ComposeOptions())
template<class Arc >
void Concat (MutableFst< Arc > *fst1, const Fst< Arc > &fst2)
template<class Arc >
void Concat (const Fst< Arc > &fst1, MutableFst< Arc > *fst2)
template<class Arc >
void Concat (RationalFst< Arc > *fst1, const Fst< Arc > &fst2)
template<class Arc >
void Concat (const Fst< Arc > &fst1, RationalFst< Arc > *fst2)
template<class Arc >
void Connect (MutableFst< Arc > *fst)
template<class Arc >
void Condense (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, std::vector< typename Arc::StateId > *scc)
template<class Arc >
void Determinize (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, const DeterminizeOptions< Arc > &opts=DeterminizeOptions< Arc >())
template<class FST , class Visitor , class ArcFilter >
void DfsVisit (const FST &fst, Visitor *visitor, ArcFilter filter, bool access_only=false)
 namespace internal
template<class Arc , class Visitor >
void DfsVisit (const Fst< Arc > &fst, Visitor *visitor)
template<class Arc >
void Difference (const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const DifferenceOptions &opts=DifferenceOptions())
template<class Arc >
void Disambiguate (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, const DisambiguateOptions< Arc > &opts=DisambiguateOptions< Arc >())
 namespace internal
template<class Arc >
void Encode (MutableFst< Arc > *fst, EncodeMapper< Arc > *mapper)
 Complexity: O(E + V).
template<class Arc >
void Decode (MutableFst< Arc > *fst, const EncodeMapper< Arc > &mapper)
template<class Arc >
void EpsNormalize (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, EpsNormalizeType type=EPS_NORM_INPUT)
template<class Arc , GallicType G>
void EpsNormalize (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, EpsNormalizeType type)
 Same as above, expect allows specifying explicitely the gallic weight type.
template<class Arc >
bool Equal (const Fst< Arc > &fst1, const Fst< Arc > &fst2, float delta=kDelta, uint32 etype=kEqualFsts)
template<class Arc >
bool Equivalent (const Fst< Arc > &fst1, const Fst< Arc > &fst2, double delta=kDelta, bool *error=nullptr)
 namespace internal
template<class Arc >
Arc::StateId CountStates (const Fst< Arc > &fst)
template<class Arc >
Arc::StateId CountArcs (const Fst< Arc > &fst)
 Function to return the number of arcs in an FST.
template<class X1 , class X2 >
ExpectationWeight< X1, X2 > Plus (const ExpectationWeight< X1, X2 > &w1, const ExpectationWeight< X1, X2 > &w2)
template<class X1 , class X2 >
ExpectationWeight< X1, X2 > Times (const ExpectationWeight< X1, X2 > &w1, const ExpectationWeight< X1, X2 > &w2)
template<class X1 , class X2 >
ExpectationWeight< X1, X2 > Divide (const ExpectationWeight< X1, X2 > &w1, const ExpectationWeight< X1, X2 > &w2, DivideType typ=DIVIDE_ANY)
template<class Arc >
void Compress (const Fst< Arc > &fst, std::ostream &strm)
 Convenience functions that call the compressor and decompressor.
template<class Arc >
bool Compress (const Fst< Arc > &fst, const string &file_name, const bool gzip=false)
 Returns true on success.
template<class Arc >
void Decompress (std::istream &strm, const string &source, MutableFst< Arc > *fst)
template<class Arc >
bool Decompress (const string &file_name, MutableFst< Arc > *fst, const bool gzip=false)
 Returns true on success.
template<class Arc >
void FarCompileStrings (const std::vector< string > &in_fnames, const string &out_fname, const string &fst_type, const FarType &far_type, int32 generate_keys, FarEntryType fet, FarTokenType tt, const string &symbols_fname, const string &unknown_symbol, bool keep_symbols, bool initial_symbols, bool allow_negative_labels, const string &key_prefix, const string &key_suffix)
template<class Arc >
void FarCreate (const std::vector< string > &in_fnames, const string &out_fname, const int32 generate_keys, const FarType &far_type, const string &key_prefix, const string &key_suffix)
template<class Arc >
bool FarEqual (const string &filename1, const string &filename2, float delta=kDelta, const string &begin_key=string(), const string &end_key=string())
template<class Arc >
void FarWriteFst (const Fst< Arc > *fst, string key, string *okey, int *nrep, int32 generate_filenames, int i, const string &filename_prefix, const string &filename_suffix)
template<class Arc >
void FarExtract (const std::vector< string > &ifilenames, int32 generate_filenames, const string &keys, const string &key_separator, const string &range_delimiter, const string &filename_prefix, const string &filename_suffix)
bool IsFst (const string &filename)
template<class Arc >
void AccumulateStatesAndArcs (const Fst< Arc > &fst, size_t *nstate, size_t *narc, size_t *nfinal)
template<class Arc >
void GetFarInfo (const std::vector< string > &filenames, const string &begin_key, const string &end_key, const bool list_fsts, FarInfoData *far_info)
template<class Arc >
void FarInfo (const std::vector< string > &filenames, const string &begin_key, const string &end_key, const bool list_fsts)
template<class Arc >
bool FarIsomorphic (const string &filename1, const string &filename2, float delta=kDelta, const string &begin_key=string(), const string &end_key=string())
template<class Arc >
void FarPrintStrings (const std::vector< string > &ifilenames, FarEntryType entry_type, FarTokenType far_token_type, const string &begin_key, const string &end_key, bool print_key, bool print_weight, const string &symbols_fname, bool initial_symbols, int32 generate_filenames, const string &filename_prefix, const string &filename_suffix)
template<class Header >
bool ReadSTListHeader (const string &filename, Header *header)
template<class Header >
bool ReadSTTableHeader (const string &filename, Header *header)
string TranslateLabel (int64 label, const SymbolTable *syms)
 For logging purposes.
template<class Iterator >
string JoinLabels (Iterator begin, Iterator end, const SymbolTable *syms)
template<class Label >
string JoinLabels (const std::vector< Label > &labels, const SymbolTable *syms)
template<class A >
A::Label GuessStartOrEnd (std::vector< typename A::Label > *sequence, typename A::Label boundary)
template<class A >
void LogLinearApply (const Fst< A > &ifst, const Fst< A > &lfst, MutableFst< A > *ofst, bool normalize=true)
template<class A , class B >
void LogLinearApply (const Fst< A > &ifst, const Fst< A > &lfst, MutableFst< A > *ofst, bool normalize=true)
template<class Arc >
void Compose (const Fst< Arc > &ifst1, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, const std::vector< typename Arc::Label > &assignments, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const MPdtComposeOptions &opts=MPdtComposeOptions())
template<class Arc >
void Compose (const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, const std::vector< typename Arc::Label > &assignments, MutableFst< Arc > *ofst, const MPdtComposeOptions &opts=MPdtComposeOptions())
uint64 MPdtExpandProperties (uint64 inprops)
 Properties for an expanded PDT.
template<class Arc >
void Expand (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, const std::vector< typename Arc::Label > &assignments, MutableFst< Arc > *ofst, const MPdtExpandOptions &opts)
template<class Arc >
void Expand (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, const std::vector< typename Arc::Label > &assignments, MutableFst< Arc > *ofst, bool connect=true, bool keep_parentheses=false)
template<typename Label >
bool ReadLabelTriples (const string &filename, std::vector< std::pair< Label, Label >> *pairs, std::vector< Label > *assignments, bool allow_negative=false)
 Returns true on success.
template<typename Label >
bool WriteLabelTriples (const string &filename, const std::vector< std::pair< Label, Label >> &pairs, const std::vector< Label > &assignments)
 Returns true on success.
template<class Arc , class RevArc >
void Reverse (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, std::vector< typename Arc::Label > *assignments, MutableFst< RevArc > *ofst)
 Reverses a multi-stack pushdown transducer (MPDT) encoded as an FST.
template<class Arc >
void Compose (const Fst< Arc > &ifst1, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const PdtComposeOptions &opts=PdtComposeOptions())
template<class Arc >
void Compose (const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, MutableFst< Arc > *ofst, const PdtComposeOptions &opts=PdtComposeOptions())
template<class Arc >
void Expand (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, MutableFst< Arc > *ofst, const PdtExpandOptions< Arc > &opts)
template<class Arc >
void Expand (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, MutableFst< Arc > *ofst, bool connect=true, bool keep_parentheses=false)
template<class Arc >
void PrintPdtInfo (const PdtInfo< Arc > &info)
template<typename S , typename K >
bool operator== (const PdtStateTuple< S, K > &x, const PdtStateTuple< S, K > &y)
 Equality of PDT state tuples.
template<class Arc >
void Replace (const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &ifst_array, MutableFst< Arc > *ofst, std::vector< std::pair< typename Arc::Label, typename Arc::Label >> *parens, const PdtReplaceOptions< Arc > &opts)
template<class Arc >
void Replace (const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &ifst_array, MutableFst< Arc > *ofst, std::vector< std::pair< typename Arc::Label, typename Arc::Label >> *parens, typename Arc::Label root)
 Variant where the only user-controlled arguments is the root ID.
template<class Arc , class RevArc >
void Reverse (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, MutableFst< RevArc > *ofst)
 Reverses a pushdown transducer (PDT) encoded as an FST.
template<class Arc , class Queue >
void ShortestPath (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, MutableFst< Arc > *ofst, const PdtShortestPathOptions< Arc, Queue > &opts)
 Functional variants.
template<class Arc >
void ShortestPath (const Fst< Arc > &ifst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &parens, MutableFst< Arc > *ofst)
template<class T >
bool operator== (const FloatWeightTpl< T > &w1, const FloatWeightTpl< T > &w2)
bool operator== (const FloatWeightTpl< double > &w1, const FloatWeightTpl< double > &w2)
bool operator== (const FloatWeightTpl< float > &w1, const FloatWeightTpl< float > &w2)
template<class T >
bool operator!= (const FloatWeightTpl< T > &w1, const FloatWeightTpl< T > &w2)
bool operator!= (const FloatWeightTpl< double > &w1, const FloatWeightTpl< double > &w2)
bool operator!= (const FloatWeightTpl< float > &w1, const FloatWeightTpl< float > &w2)
template<class T >
bool ApproxEqual (const FloatWeightTpl< T > &w1, const FloatWeightTpl< T > &w2, float delta=kDelta)
template<class T >
std::ostream & operator<< (std::ostream &strm, const FloatWeightTpl< T > &w)
template<class T >
std::istream & operator>> (std::istream &strm, FloatWeightTpl< T > &w)
template<class T >
TropicalWeightTpl< T > Plus (const TropicalWeightTpl< T > &w1, const TropicalWeightTpl< T > &w2)
TropicalWeightTpl< float > Plus (const TropicalWeightTpl< float > &w1, const TropicalWeightTpl< float > &w2)
TropicalWeightTpl< double > Plus (const TropicalWeightTpl< double > &w1, const TropicalWeightTpl< double > &w2)
template<class T >
TropicalWeightTpl< T > Times (const TropicalWeightTpl< T > &w1, const TropicalWeightTpl< T > &w2)
TropicalWeightTpl< float > Times (const TropicalWeightTpl< float > &w1, const TropicalWeightTpl< float > &w2)
TropicalWeightTpl< double > Times (const TropicalWeightTpl< double > &w1, const TropicalWeightTpl< double > &w2)
template<class T >
TropicalWeightTpl< T > Divide (const TropicalWeightTpl< T > &w1, const TropicalWeightTpl< T > &w2, DivideType typ=DIVIDE_ANY)
TropicalWeightTpl< float > Divide (const TropicalWeightTpl< float > &w1, const TropicalWeightTpl< float > &w2, DivideType typ=DIVIDE_ANY)
TropicalWeightTpl< double > Divide (const TropicalWeightTpl< double > &w1, const TropicalWeightTpl< double > &w2, DivideType typ=DIVIDE_ANY)
template<class T >
TropicalWeightTpl< T > Power (const TropicalWeightTpl< T > &weight, T scalar)
template<class T >
LogWeightTpl< T > Plus (const LogWeightTpl< T > &w1, const LogWeightTpl< T > &w2)
 namespace internal
LogWeightTpl< float > Plus (const LogWeightTpl< float > &w1, const LogWeightTpl< float > &w2)
LogWeightTpl< double > Plus (const LogWeightTpl< double > &w1, const LogWeightTpl< double > &w2)
template<class T >
LogWeightTpl< T > Times (const LogWeightTpl< T > &w1, const LogWeightTpl< T > &w2)
LogWeightTpl< float > Times (const LogWeightTpl< float > &w1, const LogWeightTpl< float > &w2)
LogWeightTpl< double > Times (const LogWeightTpl< double > &w1, const LogWeightTpl< double > &w2)
template<class T >
LogWeightTpl< T > Divide (const LogWeightTpl< T > &w1, const LogWeightTpl< T > &w2, DivideType typ=DIVIDE_ANY)
LogWeightTpl< float > Divide (const LogWeightTpl< float > &w1, const LogWeightTpl< float > &w2, DivideType typ=DIVIDE_ANY)
LogWeightTpl< double > Divide (const LogWeightTpl< double > &w1, const LogWeightTpl< double > &w2, DivideType typ=DIVIDE_ANY)
template<class T >
LogWeightTpl< T > Power (const LogWeightTpl< T > &weight, T scalar)
template<class T >
MinMaxWeightTpl< T > Plus (const MinMaxWeightTpl< T > &w1, const MinMaxWeightTpl< T > &w2)
 Min.
MinMaxWeightTpl< float > Plus (const MinMaxWeightTpl< float > &w1, const MinMaxWeightTpl< float > &w2)
MinMaxWeightTpl< double > Plus (const MinMaxWeightTpl< double > &w1, const MinMaxWeightTpl< double > &w2)
template<class T >
MinMaxWeightTpl< T > Times (const MinMaxWeightTpl< T > &w1, const MinMaxWeightTpl< T > &w2)
 Max.
MinMaxWeightTpl< float > Times (const MinMaxWeightTpl< float > &w1, const MinMaxWeightTpl< float > &w2)
MinMaxWeightTpl< double > Times (const MinMaxWeightTpl< double > &w1, const MinMaxWeightTpl< double > &w2)
template<class T >
MinMaxWeightTpl< T > Divide (const MinMaxWeightTpl< T > &w1, const MinMaxWeightTpl< T > &w2, DivideType typ=DIVIDE_ANY)
 Defined only for special cases.
MinMaxWeightTpl< float > Divide (const MinMaxWeightTpl< float > &w1, const MinMaxWeightTpl< float > &w2, DivideType typ=DIVIDE_ANY)
MinMaxWeightTpl< double > Divide (const MinMaxWeightTpl< double > &w1, const MinMaxWeightTpl< double > &w2, DivideType typ=DIVIDE_ANY)
bool IsFstHeader (std::istream &, const string &)
template<class FST >
void Destroy (ArcIterator< FST > *aiter, MemoryPool< ArcIterator< FST >> *pool)
template<class Arc >
uint64 TestProperties (const Fst< Arc > &fst, uint64 mask, uint64 *known)
 namespace internal
template<class IFST , class OFST >
void Cast (const IFST &ifst, OFST *ofst)
template<class Arc >
void FstToString (const Fst< Arc > &fst, string *result)
 FST serialization.
template<class Arc >
void FstToString (const Fst< Arc > &fst, string *result, const FstWriteOptions &options)
template<class Arc >
Fst< Arc > * StringToFst (const string &s)
template<class Label >
bool UTF8StringToLabels (const string &str, std::vector< Label > *labels)
template<class Label >
bool LabelsToUTF8String (const std::vector< Label > &labels, string *str)
template<class Arc >
void Intersect (const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst, const IntersectOptions &opts=IntersectOptions())
template<typename T , class Store >
std::ostream & operator<< (std::ostream &strm, const IntervalSet< T, Store > &s)
template<class Arc >
void Invert (MutableFst< Arc > *fst)
template<class Arc >
bool Isomorphic (const Fst< Arc > &fst1, const Fst< Arc > &fst2, float delta=kDelta)
 namespace internal
template<class W1 , class W2 >
LexicographicWeight< W1, W2 > Plus (const LexicographicWeight< W1, W2 > &w, const LexicographicWeight< W1, W2 > &v)
template<class W1 , class W2 >
LexicographicWeight< W1, W2 > Times (const LexicographicWeight< W1, W2 > &w, const LexicographicWeight< W1, W2 > &v)
template<class W1 , class W2 >
LexicographicWeight< W1, W2 > Divide (const LexicographicWeight< W1, W2 > &w, const LexicographicWeight< W1, W2 > &v, DivideType typ=DIVIDE_ANY)
template<class Matcher1 , class Matcher2 >
MatchType LookAheadMatchType (const Matcher1 &m1, const Matcher2 &m2)
template<class Arc >
MatchType LookAheadMatchType (const Fst< Arc > &fst1, const Fst< Arc > &fst2)
template<class A , class C >
void Map (MutableFst< A > *fst, C *mapper)
template<class A , class C >
void Map (MutableFst< A > *fst, C mapper)
template<class A , class B , class C >
void Map (const Fst< A > &ifst, MutableFst< B > *ofst, C *mapper)
template<class A , class B , class C >
void Map (const Fst< A > &ifst, MutableFst< B > *ofst, C mapper)
template<typename T , typename U >
bool operator== (const BlockAllocator< T > &alloc1, const BlockAllocator< U > &alloc2)
template<typename T , typename U >
bool operator!= (const BlockAllocator< T > &alloc1, const BlockAllocator< U > &alloc2)
template<typename T , typename U >
bool operator== (const PoolAllocator< T > &alloc1, const PoolAllocator< U > &alloc2)
template<typename T , typename U >
bool operator!= (const PoolAllocator< T > &alloc1, const PoolAllocator< U > &alloc2)
template<class Arc >
void Minimize (MutableFst< Arc > *fst, MutableFst< Arc > *sfst=nullptr, float delta=kDelta, bool allow_nondet=false)
 namespace internal
template<class W1 , class W2 >
bool operator== (const PairWeight< W1, W2 > &w1, const PairWeight< W1, W2 > &w2)
template<class W1 , class W2 >
bool operator!= (const PairWeight< W1, W2 > &w1, const PairWeight< W1, W2 > &w2)
template<class W1 , class W2 >
bool ApproxEqual (const PairWeight< W1, W2 > &w1, const PairWeight< W1, W2 > &w2, float delta=kDelta)
template<class W1 , class W2 >
std::ostream & operator<< (std::ostream &strm, const PairWeight< W1, W2 > &weight)
template<class W1 , class W2 >
std::istream & operator>> (std::istream &strm, PairWeight< W1, W2 > &weight)
template<class W , size_t n>
PowerWeight< W, n > Plus (const PowerWeight< W, n > &w1, const PowerWeight< W, n > &w2)
 Semiring plus operation.
template<class W , size_t n>
PowerWeight< W, n > Times (const PowerWeight< W, n > &w1, const PowerWeight< W, n > &w2)
 Semiring times operation.
template<class W , size_t n>
PowerWeight< W, n > Divide (const PowerWeight< W, n > &w1, const PowerWeight< W, n > &w2, DivideType type=DIVIDE_ANY)
 Semiring divide operation.
template<class W , size_t n>
PowerWeight< W, n > Times (const W &scalar, const PowerWeight< W, n > &weight)
 Semimodule left scalar product.
template<class W , size_t n>
PowerWeight< W, n > Times (const PowerWeight< W, n > &weight, const W &scalar)
 Semimodule right scalar product.
template<class W , size_t n>
DotProduct (const PowerWeight< W, n > &w1, const PowerWeight< W, n > &w2)
 Semimodule dot product.
template<class W1 , class W2 >
ProductWeight< W1, W2 > Plus (const ProductWeight< W1, W2 > &w1, const ProductWeight< W1, W2 > &w2)
template<class W1 , class W2 >
ProductWeight< W1, W2 > Times (const ProductWeight< W1, W2 > &w1, const ProductWeight< W1, W2 > &w2)
template<class W1 , class W2 >
ProductWeight< W1, W2 > Divide (const ProductWeight< W1, W2 > &w1, const ProductWeight< W1, W2 > &w2, DivideType typ=DIVIDE_ANY)
template<class Arc >
void Project (MutableFst< Arc > *fst, ProjectType project_type)
uint64 SetStartProperties (uint64 inprops)
 PROPERTY FUNCTIONS and STRING NAMES (defined in properties.cc).
template<typename Weight >
uint64 SetFinalProperties (uint64 inprops, Weight old_weight, Weight new_weight)
 Definitions of template functions.
uint64 AddStateProperties (uint64 inprops)
template<typename A >
uint64 AddArcProperties (uint64 inprops, typename A::StateId s, const A &arc, const A *prev_arc)
uint64 DeleteStatesProperties (uint64 inprops)
uint64 DeleteAllStatesProperties (uint64 inprops, uint64 staticProps)
uint64 DeleteArcsProperties (uint64 inprops)
uint64 ClosureProperties (uint64 inprops, bool star, bool delayed)
 Properties for a concatenatively-closed FST.
uint64 ComplementProperties (uint64 inprops)
 Properties for a complemented FST.
uint64 ComposeProperties (uint64 inprops1, uint64 inprops2)
 Properties for a composed FST.
uint64 ConcatProperties (uint64 inprops1, uint64 inprops2, bool delayed)
 Properties for a concatenated FST.
uint64 DeterminizeProperties (uint64 inprops, bool has_subsequential_label, bool distinct_psubsequential_labels)
 Properties for a determinized FST.
uint64 FactorWeightProperties (uint64 inprops)
 Properties for factored weight FST.
uint64 InvertProperties (uint64 inprops)
 Properties for an inverted FST.
uint64 ProjectProperties (uint64 inprops, bool project_input)
 Properties for a projected FST.
uint64 RandGenProperties (uint64 inprops, bool weighted)
 Properties for a randgen FST.
uint64 RelabelProperties (uint64 inprops)
 Properties for a relabeled FST.
uint64 ReplaceProperties (const std::vector< uint64 > &inprops, ssize_t root, bool epsilon_on_call, bool epsilon_on_return, bool out_epsilon_on_call, bool out_epsilon_on_return, bool replace_transducer, bool no_empty_fsts, bool all_ilabel_sorted, bool all_olabel_sorted, bool all_negative_or_dense)
 Properties for a replace FST.
uint64 ReverseProperties (uint64 inprops, bool has_superinitial)
 Properties for a reversed FST (the superinitial state limits this set).
uint64 ReweightProperties (uint64 inprops)
 Properties for re-weighted FST.
uint64 RmEpsilonProperties (uint64 inprops, bool delayed)
 Properties for an epsilon-removed FST.
uint64 ShortestPathProperties (uint64 props, bool tree=false)
uint64 SynchronizeProperties (uint64 inprops)
 Properties for a synchronized FST.
uint64 UnionProperties (uint64 inprops1, uint64 inprops2, bool delayed)
 Properties for a unioned FST.
template<typename Arc >
uint64 AddArcProperties (uint64 inprops, typename Arc::StateId s, const Arc &arc, const Arc *prev_arc)
template<class Arc , class ArcFilter , typename std::enable_if< (Arc::Weight::Properties()&kPath)==kPath >::type * = nullptr>
void Prune (MutableFst< Arc > *fst, const PruneOptions< Arc, ArcFilter > &opts)
template<class Arc >
void Prune (MutableFst< Arc > *fst, typename Arc::Weight weight_threshold, typename Arc::StateId state_threshold=kNoStateId, double delta=kDelta)
template<class Arc , class ArcFilter , typename std::enable_if< (Arc::Weight::Properties()&kPath)==kPath >::type * = nullptr>
void Prune (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, const PruneOptions< Arc, ArcFilter > &opts)
template<class Arc >
void Prune (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, typename Arc::Weight weight_threshold, typename Arc::StateId state_threshold=kNoStateId, float delta=kDelta)
template<class Arc >
Arc::Weight ComputeTotalWeight (const Fst< Arc > &fst, const std::vector< typename Arc::Weight > &distance, bool reverse)
template<class Arc >
void RemoveWeight (MutableFst< Arc > *fst, const typename Arc::Weight &weight, bool at_final)
template<class Arc >
void Push (MutableFst< Arc > *fst, ReweightType type, float delta=kDelta, bool remove_total_weight=false)
template<class Arc , ReweightType rtype>
void Push (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, uint32 ptype, float delta=kDelta)
template<class Arc , class ArcSelector >
bool RandEquivalent (const Fst< Arc > &fst1, const Fst< Arc > &fst2, int32 num_paths, float delta, const RandGenOptions< ArcSelector > &opts, bool *error=nullptr)
template<class Arc >
bool RandEquivalent (const Fst< Arc > &fst1, const Fst< Arc > &fst2, int32 num_paths, float delta=kDelta, time_t seed=time(nullptr), int32 max_length=std::numeric_limits< int32 >::max(), bool *error=nullptr)
template<class Result , class RNG >
void OneMultinomialSample (const std::vector< double > &probs, size_t num_to_sample, Result *result, RNG *rng)
template<class FromArc , class ToArc , class Selector >
void RandGen (const Fst< FromArc > &ifst, MutableFst< ToArc > *ofst, const RandGenOptions< Selector > &opts)
 namespace internal
template<class FromArc , class ToArc >
void RandGen (const Fst< FromArc > &ifst, MutableFst< ToArc > *ofst)
template<class Arc >
void Union (RationalFst< Arc > *fst1, const Fst< Arc > &fst2)
 Computes the union of two FSTs, modifying the RationalFst argument.
template<class Arc >
Fst< Arc > * Convert (const Fst< Arc > &fst, const string &fst_type)
 Converts an FST to the specified type.
template<class Arc >
void Relabel (MutableFst< Arc > *fst, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &ipairs, const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &opairs)
template<class Arc >
void Relabel (MutableFst< Arc > *fst, const SymbolTable *old_isymbols, const SymbolTable *new_isymbols, const string &unknown_isymbol, bool attach_new_isymbols, const SymbolTable *old_osymbols, const SymbolTable *new_osymbols, const string &unknown_osymbol, bool attach_new_osymbols)
template<class Arc >
void Relabel (MutableFst< Arc > *fst, const SymbolTable *old_isymbols, const SymbolTable *new_isymbols, bool attach_new_isymbols, const SymbolTable *old_osymbols, const SymbolTable *new_osymbols, bool attach_new_osymbols)
template<class Arc >
void Relabel (MutableFst< Arc > *fst, const SymbolTable *new_isymbols, const SymbolTable *new_osymbols)
template<class Arc >
void Replace (const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &, MutableFst< Arc > *, const ReplaceUtilOptions &)
 Defined in replace.h.
template<class StateId , class PrefixId >
bool operator== (const ReplaceStateTuple< StateId, PrefixId > &x, const ReplaceStateTuple< StateId, PrefixId > &y)
 Equality of replace state tuples.
template<class Label , class StateId >
bool operator== (const ReplaceStackPrefix< Label, StateId > &x, const ReplaceStackPrefix< Label, StateId > &y)
 Equality stack prefix classes.
bool EpsilonOnInput (ReplaceLabelType label_type)
 Returns true if label type on arc results in epsilon input label.
bool EpsilonOnOutput (ReplaceLabelType label_type)
 Returns true if label type on arc results in epsilon input label.
template<class Label >
bool ReplaceTransducer (ReplaceLabelType call_label_type, ReplaceLabelType return_label_type, Label call_output_label)
 Returns true if for either the call or return arc ilabel != olabel.
template<class Arc >
uint64 ReplaceFstProperties (typename Arc::Label root_label, const FstList< Arc > &fst_list, ReplaceLabelType call_label_type, ReplaceLabelType return_label_type, typename Arc::Label call_output_label, bool *sorted_and_non_empty)
template<class Arc >
void Replace (const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &ifst_array, MutableFst< Arc > *ofst, ReplaceFstOptions< Arc > opts=ReplaceFstOptions< Arc >())
template<class Arc >
void Replace (const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &ifst_array, MutableFst< Arc > *ofst, typename Arc::Label root, bool epsilon_on_replace)
 For backwards compatibility.
template<class Arc >
void Replace (const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &ifst_array, MutableFst< Arc > *ofst, typename Arc::Label root)
template<class FromArc , class ToArc >
void Reverse (const Fst< FromArc > &ifst, MutableFst< ToArc > *ofst, bool require_superinitial=true)
template<class Arc >
void Reweight (MutableFst< Arc > *fst, const std::vector< typename Arc::Weight > &potential, ReweightType type)
template<class Arc , class Queue >
void RmEpsilon (MutableFst< Arc > *fst, std::vector< typename Arc::Weight > *distance, const RmEpsilonOptions< Arc, Queue > &opts)
 namespace internal
template<class Arc >
void RmEpsilon (MutableFst< Arc > *fst, bool connect=true, typename Arc::Weight weight_threshold=Arc::Weight::Zero(), typename Arc::StateId state_threshold=kNoStateId, float delta=kDelta)
template<class Arc >
void RmFinalEpsilon (MutableFst< Arc > *fst)
 Removes final states that have epsilon-only input arcs.
void PrintFstInfoImpl (const FstInfo &fstinfo, bool pipe=false)
template<typename Label , SetType S>
bool operator== (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
 Default ==.
template<typename Label >
bool operator== (const SetWeight< Label, SET_BOOLEAN > &w1, const SetWeight< Label, SET_BOOLEAN > &w2)
 Boolean ==.
template<typename Label , SetType S>
bool operator!= (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
template<typename Label , SetType S>
bool ApproxEqual (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2, float delta=kDelta)
template<typename Label , SetType S>
std::ostream & operator<< (std::ostream &strm, const SetWeight< Label, S > &weight)
template<typename Label , SetType S>
std::istream & operator>> (std::istream &strm, SetWeight< Label, S > &weight)
template<typename Label , SetType S>
SetWeight< Label, S > Union (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
template<typename Label , SetType S>
SetWeight< Label, S > Intersect (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
template<typename Label , SetType S>
SetWeight< Label, S > Difference (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
template<typename Label , SetType S>
SetWeight< Label, S > Plus (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
 Default: Plus = Intersect.
template<typename Label >
SetWeight< Label,
SET_UNION_INTERSECT > 
Plus (const SetWeight< Label, SET_UNION_INTERSECT > &w1, const SetWeight< Label, SET_UNION_INTERSECT > &w2)
 Plus = Union.
template<typename Label >
SetWeight< Label,
SET_INTERSECT_UNION_RESTRICT > 
Plus (const SetWeight< Label, SET_INTERSECT_UNION_RESTRICT > &w1, const SetWeight< Label, SET_INTERSECT_UNION_RESTRICT > &w2)
template<typename Label >
SetWeight< Label, SET_BOOLEAN > Plus (const SetWeight< Label, SET_BOOLEAN > &w1, const SetWeight< Label, SET_BOOLEAN > &w2)
 Plus = Or.
template<typename Label , SetType S>
SetWeight< Label, S > Times (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2)
 Default: Times = Union.
template<typename Label >
SetWeight< Label,
SET_UNION_INTERSECT > 
Times (const SetWeight< Label, SET_UNION_INTERSECT > &w1, const SetWeight< Label, SET_UNION_INTERSECT > &w2)
 Times = Intersect.
template<typename Label >
SetWeight< Label, SET_BOOLEAN > Times (const SetWeight< Label, SET_BOOLEAN > &w1, const SetWeight< Label, SET_BOOLEAN > &w2)
 Times = And.
template<typename Label , SetType S>
SetWeight< Label, S > Divide (const SetWeight< Label, S > &w1, const SetWeight< Label, S > &w2, DivideType divide_type=DIVIDE_ANY)
 Divide = Difference.
template<typename Label >
SetWeight< Label,
SET_UNION_INTERSECT > 
Divide (const SetWeight< Label, SET_UNION_INTERSECT > &w1, const SetWeight< Label, SET_UNION_INTERSECT > &w2, DivideType divide_type=DIVIDE_ANY)
template<typename Label >
SetWeight< Label, SET_BOOLEAN > Divide (const SetWeight< Label, SET_BOOLEAN > &w1, const SetWeight< Label, SET_BOOLEAN > &w2, DivideType divide_type=DIVIDE_ANY)
 Divide = Or Not.
template<class Arc , class Queue , class ArcFilter >
void ShortestDistance (const Fst< Arc > &fst, std::vector< typename Arc::Weight > *distance, const ShortestDistanceOptions< Arc, Queue, ArcFilter > &opts)
 namespace internal
template<class Arc >
void ShortestDistance (const Fst< Arc > &fst, std::vector< typename Arc::Weight > *distance, bool reverse=false, float delta=kDelta)
template<class Arc >
Arc::Weight ShortestDistance (const Fst< Arc > &fst, float delta=kDelta)
template<class Arc , class Queue , class ArcFilter , typename std::enable_if< (Arc::Weight::Properties()&(kPath|kSemiring))==(kPath|kSemiring)>::type * = nullptr>
void ShortestPath (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, std::vector< typename Arc::Weight > *distance, const ShortestPathOptions< Arc, Queue, ArcFilter > &opts)
 namespace internal
template<class Arc >
void ShortestPath (const Fst< Arc > &ifst, MutableFst< Arc > *ofst, int32 nshortest=1, bool unique=false, bool first_path=false, typename Arc::Weight weight_threshold=Arc::Weight::Zero(), typename Arc::StateId state_threshold=kNoStateId)
template<class T >
SignedLogWeightTpl< T > Plus (const SignedLogWeightTpl< T > &w1, const SignedLogWeightTpl< T > &w2)
template<class T >
SignedLogWeightTpl< T > Minus (const SignedLogWeightTpl< T > &w1, const SignedLogWeightTpl< T > &w2)
template<class T >
SignedLogWeightTpl< T > Times (const SignedLogWeightTpl< T > &w1, const SignedLogWeightTpl< T > &w2)
template<class T >
SignedLogWeightTpl< T > Divide (const SignedLogWeightTpl< T > &w1, const SignedLogWeightTpl< T > &w2, DivideType typ=DIVIDE_ANY)
template<class T >
bool ApproxEqual (const SignedLogWeightTpl< T > &w1, const SignedLogWeightTpl< T > &w2, float delta=kDelta)
template<class T >
bool operator== (const SignedLogWeightTpl< T > &w1, const SignedLogWeightTpl< T > &w2)
template<class W1 , class W2 >
bool SignedLogConvertCheck (W1 weight)
template<class W , class K >
SparsePowerWeight< W, K > Plus (const SparsePowerWeight< W, K > &w1, const SparsePowerWeight< W, K > &w2)
 Semimodule plus operation.
template<class W , class K >
SparsePowerWeight< W, K > Times (const SparsePowerWeight< W, K > &w1, const SparsePowerWeight< W, K > &w2)
 Semimodule times operation.
template<class W , class K >
SparsePowerWeight< W, K > Divide (const SparsePowerWeight< W, K > &w1, const SparsePowerWeight< W, K > &w2, DivideType type=DIVIDE_ANY)
 Semimodule divide operation.
template<class W , class K >
const W & DotProduct (const SparsePowerWeight< W, K > &w1, const SparsePowerWeight< W, K > &w2)
 Semimodule dot product operation.
template<class W , class K >
bool ApproxEqual (const SparsePowerWeight< W, K > &w1, const SparsePowerWeight< W, K > &w2, float delta=kDelta)
template<class W , class K >
SparsePowerWeight< W, K > Times (const W &k, const SparsePowerWeight< W, K > &w2)
template<class W , class K >
SparsePowerWeight< W, K > Times (const SparsePowerWeight< W, K > &w1, const W &k)
template<class W , class K >
SparsePowerWeight< W, K > Divide (const SparsePowerWeight< W, K > &w1, const W &k, DivideType divide_type=DIVIDE_ANY)
template<class W , class K , class M >
void SparseTupleWeightMap (SparseTupleWeight< W, K > *result, const SparseTupleWeight< W, K > &w1, const SparseTupleWeight< W, K > &w2, const M &operator_mapper)
template<class W , class K >
bool operator== (const SparseTupleWeight< W, K > &w1, const SparseTupleWeight< W, K > &w2)
template<class W , class K >
bool operator!= (const SparseTupleWeight< W, K > &w1, const SparseTupleWeight< W, K > &w2)
template<class W , class K >
std::ostream & operator<< (std::ostream &strm, const SparseTupleWeight< W, K > &weight)
template<class W , class K >
std::istream & operator>> (std::istream &strm, SparseTupleWeight< W, K > &weight)
template<class A , class C >
void StateMap (MutableFst< A > *fst, C *mapper)
template<class A , class C >
void StateMap (MutableFst< A > *fst, C mapper)
template<class A , class B , class C >
void StateMap (const Fst< A > &ifst, MutableFst< B > *ofst, C *mapper)
template<class A , class B , class C >
void StateMap (const Fst< A > &ifst, MutableFst< B > *ofst, C mapper)
template<class Arc >
void StateSort (MutableFst< Arc > *fst, const std::vector< typename Arc::StateId > &order)
constexpr StringType ReverseStringType (StringType s)
template<typename Label , StringType S>
bool operator== (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2)
template<typename Label , StringType S>
bool operator!= (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2)
template<typename Label , StringType S>
bool ApproxEqual (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2, float delta=kDelta)
template<typename Label , StringType S>
std::ostream & operator<< (std::ostream &strm, const StringWeight< Label, S > &weight)
template<typename Label , StringType S>
std::istream & operator>> (std::istream &strm, StringWeight< Label, S > &weight)
template<typename Label , StringType S>
StringWeight< Label, S > Plus (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2)
template<typename Label >
StringWeight< Label, STRING_LEFT > Plus (const StringWeight< Label, STRING_LEFT > &w1, const StringWeight< Label, STRING_LEFT > &w2)
 Longest common prefix for left string semiring.
template<typename Label >
StringWeight< Label, STRING_RIGHT > Plus (const StringWeight< Label, STRING_RIGHT > &w1, const StringWeight< Label, STRING_RIGHT > &w2)
 Longest common suffix for right string semiring.
template<typename Label , StringType S>
StringWeight< Label, S > Times (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2)
template<typename Label , StringType S>
StringWeight< Label, S > DivideLeft (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2)
 Left division in a left string semiring.
template<typename Label , StringType S>
StringWeight< Label, S > DivideRight (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2)
 Right division in a right string semiring.
template<typename Label , StringType S>
StringWeight< Label, S > Divide (const StringWeight< Label, S > &w1, const StringWeight< Label, S > &w2, DivideType divide_type)
 Default is the restricted string semiring.
template<typename Label >
StringWeight< Label, STRING_LEFT > Divide (const StringWeight< Label, STRING_LEFT > &w1, const StringWeight< Label, STRING_LEFT > &w2, DivideType divide_type)
 Left division in the left string semiring.
template<typename Label >
StringWeight< Label, STRING_RIGHT > Divide (const StringWeight< Label, STRING_RIGHT > &w1, const StringWeight< Label, STRING_RIGHT > &w2, DivideType divide_type)
 Right division in the right string semiring.
constexpr StringType GallicStringType (GallicType g)
constexpr GallicType ReverseGallicType (GallicType g)
template<class Label , class W , GallicType G>
GallicWeight< Label, W, G > Plus (const GallicWeight< Label, W, G > &w, const GallicWeight< Label, W, G > &v)
 Default plus.
template<class Label , class W >
GallicWeight< Label, W,
GALLIC_MIN > 
Plus (const GallicWeight< Label, W, GALLIC_MIN > &w1, const GallicWeight< Label, W, GALLIC_MIN > &w2)
 Min gallic plus.
template<class Label , class W , GallicType G>
GallicWeight< Label, W, G > Times (const GallicWeight< Label, W, G > &w, const GallicWeight< Label, W, G > &v)
template<class Label , class W , GallicType G>
GallicWeight< Label, W, G > Divide (const GallicWeight< Label, W, G > &w, const GallicWeight< Label, W, G > &v, DivideType divide_type=DIVIDE_ANY)
template<class Label , class W >
GallicWeight< Label, W, GALLIC > Plus (const GallicWeight< Label, W, GALLIC > &w1, const GallicWeight< Label, W, GALLIC > &w2)
 (General) gallic plus.
template<class Label , class W >
GallicWeight< Label, W, GALLIC > Times (const GallicWeight< Label, W, GALLIC > &w1, const GallicWeight< Label, W, GALLIC > &w2)
 (General) gallic times.
template<class Label , class W >
GallicWeight< Label, W, GALLIC > Divide (const GallicWeight< Label, W, GALLIC > &w1, const GallicWeight< Label, W, GALLIC > &w2, DivideType divide_type=DIVIDE_ANY)
 (General) gallic divide.
template<class Arc >
SymbolTablePruneSymbolTable (const Fst< Arc > &fst, const SymbolTable &syms, bool input)
SymbolTableCompactSymbolTable (const SymbolTable &syms)
 Relabels a symbol table to make it a contiguous mapping.
SymbolTableMergeSymbolTable (const SymbolTable &left, const SymbolTable &right, bool *right_relabel_output=nullptr)
SymbolTableFstReadSymbols (const string &filename, bool input)
bool AddAuxiliarySymbols (const string &prefix, int64 start_label, int64 nlabels, SymbolTable *syms)
template<class Label >
SymbolTableRelabelSymbolTable (const SymbolTable *table, const std::vector< std::pair< Label, Label >> &pairs)
bool CompatSymbols (const SymbolTable *syms1, const SymbolTable *syms2, bool warning)
 namespace internal
void SymbolTableToString (const SymbolTable *table, string *result)
 Symbol Table serialization.
SymbolTableStringToSymbolTable (const string &str)
template<class Arc >
void Synchronize (const Fst< Arc > &ifst, MutableFst< Arc > *ofst)
uint64 KnownProperties (uint64 props)
 namespace internal {
bool CompatProperties (uint64 props1, uint64 props2)
 Tests compatibility between two sets of properties.
template<class Arc >
uint64 ComputeProperties (const Fst< Arc > &fst, uint64 mask, uint64 *known, bool use_stored)
template<class Arc >
uint64 CheckProperties (const Fst< Arc > &fst, uint64 check_mask, uint64 test_mask)
template<class Arc >
bool TopSort (MutableFst< Arc > *fst)
template<class W , size_t n>
bool operator== (const TupleWeight< W, n > &w1, const TupleWeight< W, n > &w2)
template<class W , size_t n>
bool operator!= (const TupleWeight< W, n > &w1, const TupleWeight< W, n > &w2)
template<class W , size_t n>
bool ApproxEqual (const TupleWeight< W, n > &w1, const TupleWeight< W, n > &w2, float delta=kDelta)
template<class W , size_t n>
std::ostream & operator<< (std::ostream &strm, const TupleWeight< W, n > &w)
template<class W , size_t n>
std::istream & operator>> (std::istream &strm, TupleWeight< W, n > &w)
template<class W , class O >
bool operator== (const UnionWeight< W, O > &w1, const UnionWeight< W, O > &w2)
 Requires union weight has been canonicalized.
template<class W , class O >
bool operator!= (const UnionWeight< W, O > &w1, const UnionWeight< W, O > &w2)
 Requires union weight has been canonicalized.
template<class W , class O >
bool ApproxEqual (const UnionWeight< W, O > &w1, const UnionWeight< W, O > &w2, float delta=kDelta)
 Requires union weight has been canonicalized.
template<class W , class O >
std::ostream & operator<< (std::ostream &ostrm, const UnionWeight< W, O > &weight)
template<class W , class O >
std::istream & operator>> (std::istream &istrm, UnionWeight< W, O > &weight)
template<class W , class O >
UnionWeight< W, O > Plus (const UnionWeight< W, O > &w1, const UnionWeight< W, O > &w2)
template<class W , class O >
UnionWeight< W, O > Times (const UnionWeight< W, O > &w1, const UnionWeight< W, O > &w2)
template<class W , class O >
UnionWeight< W, O > Divide (const UnionWeight< W, O > &w1, const UnionWeight< W, O > &w2, DivideType typ)
template<class Arc >
void Union (MutableFst< Arc > *fst1, const Fst< Arc > &fst2)
template<class T , typename std::enable_if< std::is_class< T >::value, T >::type * = nullptr>
std::istream & ReadType (std::istream &strm, T *t)
 Utility for type I/O.
std::istream & ReadType (std::istream &strm, string *s)
 String case.
template<class... T>
std::istream & ReadType (std::istream &strm, std::vector< T...> *c)
 Declares types that can be read from an input stream.
template<class... T>
std::istream & ReadType (std::istream &strm, std::list< T...> *c)
template<class... T>
std::istream & ReadType (std::istream &strm, std::set< T...> *c)
template<class... T>
std::istream & ReadType (std::istream &strm, std::map< T...> *c)
template<class... T>
std::istream & ReadType (std::istream &strm, std::unordered_map< T...> *c)
template<class... T>
std::istream & ReadType (std::istream &strm, std::unordered_set< T...> *c)
template<typename S , typename T >
std::istream & ReadType (std::istream &strm, std::pair< S, T > *p)
 Pair case.
template<typename S , typename T >
std::istream & ReadType (std::istream &strm, std::pair< const S, T > *p)
template<class T , typename std::enable_if< std::is_class< T >::value, T >::type * = nullptr>
std::ostream & WriteType (std::ostream &strm, const T t)
 Writes types to an output stream.
std::ostream & WriteType (std::ostream &strm, const string &s)
 String case.
template<typename... T>
std::ostream & WriteType (std::ostream &strm, const std::vector< T...> &c)
 Declares types that can be written to an output stream.
template<typename... T>
std::ostream & WriteType (std::ostream &strm, const std::list< T...> &c)
template<typename... T>
std::ostream & WriteType (std::ostream &strm, const std::set< T...> &c)
template<typename... T>
std::ostream & WriteType (std::ostream &strm, const std::map< T...> &c)
template<typename... T>
std::ostream & WriteType (std::ostream &strm, const std::unordered_map< T...> &c)
template<typename... T>
std::ostream & WriteType (std::ostream &strm, const std::unordered_set< T...> &c)
template<typename S , typename T >
std::ostream & WriteType (std::ostream &strm, const std::pair< S, T > &p)
 Pair case.
int64 StrToInt64 (const string &s, const string &src, size_t nline, bool allow_negative, bool *error=nullptr)
 Utilities for converting between int64 or Weight and string.
template<typename Weight >
Weight StrToWeight (const string &s, const string &src, size_t nline)
template<typename Weight >
void WeightToStr (Weight w, string *s)
void SplitToVector (char *line, const char *delim, std::vector< char * > *vec, bool omit_empty_strings)
 Utilities for reading/writing integer pairs (typically labels).
template<typename I >
bool ReadIntPairs (const string &filename, std::vector< std::pair< I, I >> *pairs, bool allow_negative=false)
template<typename I >
bool WriteIntPairs (const string &filename, const std::vector< std::pair< I, I >> &pairs)
template<typename Label >
bool ReadLabelPairs (const string &filename, std::vector< std::pair< Label, Label >> *pairs, bool allow_negative=false)
 Utilities for reading/writing label pairs.
template<typename Label >
bool WriteLabelPairs (const string &filename, const std::vector< std::pair< Label, Label >> &pairs)
void ConvertToLegalCSymbol (string *s)
 Utilities for converting a type name to a legal C symbol.
bool AlignInput (std::istream &strm)
 Utilities for stream I/O.
bool AlignOutput (std::ostream &strm)
template<class Arc >
bool Verify (const Fst< Arc > &fst, bool allow_negative_labels=false)
 Verifies that an Fst's contents are sane.
template<class FST , class Visitor , class Queue , class ArcFilter >
void Visit (const FST &fst, Visitor *visitor, Queue *queue, ArcFilter filter, bool access_only=false)
template<class Arc , class Visitor , class Queue >
void Visit (const Fst< Arc > &fst, Visitor *visitor, Queue *queue)
template<class Weight >
Weight Power (Weight w, size_t n)
 REGISTER_FST (VectorFst, StdArc)
 Registers VectorFst, ConstFst and EditFst for common arcs types.
 REGISTER_FST (VectorFst, LogArc)
 REGISTER_FST (VectorFst, Log64Arc)
 REGISTER_FST (ConstFst, StdArc)
 REGISTER_FST (ConstFst, LogArc)
 REGISTER_FST (ConstFst, Log64Arc)
 REGISTER_FST (EditFst, StdArc)
 REGISTER_FST (EditFst, LogArc)
 REGISTER_FST (EditFst, Log64Arc)
 REGISTER_FST (CompactStringFst, StdArc)
 Register CompactFst for common arcs with the default (uint32) size type.
 REGISTER_FST (CompactStringFst, LogArc)
 REGISTER_FST (CompactWeightedStringFst, StdArc)
 REGISTER_FST (CompactWeightedStringFst, LogArc)
 REGISTER_FST (CompactAcceptorFst, StdArc)
 REGISTER_FST (CompactAcceptorFst, LogArc)
 REGISTER_FST (CompactUnweightedFst, StdArc)
 REGISTER_FST (CompactUnweightedFst, LogArc)
 REGISTER_FST (CompactUnweightedAcceptorFst, StdArc)
 REGISTER_FST (CompactUnweightedAcceptorFst, LogArc)
template<class Arc >
void LookAheadCompose (const Fst< Arc > &ifst1, const Fst< Arc > &ifst2, MutableFst< Arc > *ofst)
 Generic - no lookahead.
void LookAheadCompose (const Fst< StdArc > &ifst1, const Fst< StdArc > &ifst2, MutableFst< StdArc > *ofst)
 Specialized and epsilon olabel acyclic - lookahead.
template<class Arc , class WeightGenerator >
void RandFst (const int num_random_states, const int num_random_arcs, const int num_random_labels, const float acyclic_prob, WeightGenerator *weight_generator, MutableFst< Arc > *fst)
 Generates a random FST.

Variables

const char phi_fst_type [] = "phi"
const char input_phi_fst_type [] = "input_phi"
const char output_phi_fst_type [] = "output_phi"
const char rho_fst_type [] = "rho"
const char input_rho_fst_type [] = "input_rho"
const char output_rho_fst_type [] = "output_rho"
const char sigma_fst_type [] = "sigma"
const char input_sigma_fst_type [] = "input_sigma"
const char output_sigma_fst_type [] = "output_sigma"
constexpr uint32 kCacheFinal = 0x0001
 Cache flags.
constexpr uint32 kCacheArcs = 0x0002
 Arcs have been cached.
constexpr uint32 kCacheInit = 0x0004
 Initialized by GC.
constexpr uint32 kCacheRecent = 0x0008
 Visited since GC.
constexpr uint32 kCacheFlags
constexpr uint32 kEqualFsts = 0x0001
constexpr uint32 kEqualFstTypes = 0x0002
constexpr uint32 kEqualCompatProperties = 0x0004
constexpr uint32 kEqualCompatSymbols = 0x0008
constexpr uint32 kEqualAll
constexpr uint32 kGzipMask = 0xffffffff >> 16
 Selects the two most significant bytes.
const int kNoTrieNodeId = -1
constexpr uint32 kParenList = 0x00000001
 Returns paren arcs for Find(kNoLabel).
constexpr uint32 kParenLoop = 0x00000002
 Returns a kNolabel loop for Find(paren).
constexpr uint8 kPhiFstMatchInput = 0x01
 namespace internal
constexpr uint8 kPhiFstMatchOutput = 0x02
 Output matcher is PhiMatcher.
constexpr uint8 kRhoFstMatchInput = 0x01
 namespace internal
constexpr uint8 kRhoFstMatchOutput = 0x02
 Output matcher is RhoMatcher.
constexpr uint8 kSigmaFstMatchInput = 0x01
 namespace internal
constexpr uint8 kSigmaFstMatchOutput = 0x02
 Output matcher is SigmaMatcher.
constexpr uint32 kFactorFinalWeights = 0x00000001
constexpr uint32 kFactorArcWeights = 0x00000002
constexpr int kNoStateId = -1
 Not a valid state ID.
constexpr int kNoLabel = -1
 Not a valid label.
constexpr uint32 kInputLookAheadMatcher = 0x00000010
constexpr uint32 kOutputLookAheadMatcher = 0x00000020
 Matcher is a lookahead matcher when match_type is MATCH_OUTPUT.
constexpr uint32 kLookAheadWeight = 0x00000040
constexpr uint32 kLookAheadPrefix = 0x00000080
constexpr uint32 kLookAheadNonEpsilons = 0x00000100
 Look-ahead of matcher FST non-epsilon arcs?
constexpr uint32 kLookAheadEpsilons = 0x00000200
 Look-ahead of matcher FST epsilon arcs?
constexpr uint32 kLookAheadNonEpsilonPrefix = 0x00000400
constexpr uint32 kLookAheadKeepRelabelData = 0x00000800
 For LabelLookAheadMatcher, save relabeling data to file?
constexpr uint32 kLookAheadFlags = 0x00000ff0
 Flags used for lookahead matchers.
const char arc_lookahead_fst_type [] = "arc_lookahead"
 Useful aliases when using StdArc.
const char ilabel_lookahead_fst_type [] = "ilabel_lookahead"
const char olabel_lookahead_fst_type [] = "olabel_lookahead"
constexpr auto ilabel_lookahead_flags
constexpr auto olabel_lookahead_flags
constexpr uint32 kRequireMatch = 0x00000001
 Basic matcher flags.
constexpr uint32 kMatcherFlags = kRequireMatch
 Flags used for basic matchers (see also lookahead.h).
constexpr ssize_t kRequirePriority = -1
 Matcher priority that is mandatory.
const uint32 kMultiEpsList = 0x00000001
 Flags for MultiEpsMatcher.
const uint32 kMultiEpsLoop = 0x00000002
 Return a kNolabel loop for Find(multi_eps).
constexpr int kAllocSize = 64
 Default block allocation size.
constexpr int kAllocFit = 4
 Minimum number of allocations per block.
constexpr uint64 kExpanded = 0x0000000000000001ULL
 The Fst is an ExpandedFst.
constexpr uint64 kMutable = 0x0000000000000002ULL
 The Fst is a MutableFst.
constexpr uint64 kError = 0x0000000000000004ULL
 An error was detected while constructing/using the FST.
constexpr uint64 kAcceptor = 0x0000000000010000ULL
 ilabel == olabel for each arc.
constexpr uint64 kNotAcceptor = 0x0000000000020000ULL
 ilabel != olabel for some arc.
constexpr uint64 kIDeterministic = 0x0000000000040000ULL
 ilabels unique leaving each state.
constexpr uint64 kNonIDeterministic = 0x0000000000080000ULL
 ilabels not unique leaving some state.
constexpr uint64 kODeterministic = 0x0000000000100000ULL
 olabels unique leaving each state.
constexpr uint64 kNonODeterministic = 0x0000000000200000ULL
 olabels not unique leaving some state.
constexpr uint64 kEpsilons = 0x0000000000400000ULL
 FST has input/output epsilons.
constexpr uint64 kNoEpsilons = 0x0000000000800000ULL
 FST has no input/output epsilons.
constexpr uint64 kIEpsilons = 0x0000000001000000ULL
 FST has input epsilons.
constexpr uint64 kNoIEpsilons = 0x0000000002000000ULL
 FST has no input epsilons.
constexpr uint64 kOEpsilons = 0x0000000004000000ULL
 FST has output epsilons.
constexpr uint64 kNoOEpsilons = 0x0000000008000000ULL
 FST has no output epsilons.
constexpr uint64 kILabelSorted = 0x0000000010000000ULL
 ilabels sorted wrt < for each state.
constexpr uint64 kNotILabelSorted = 0x0000000020000000ULL
 ilabels not sorted wrt < for some state.
constexpr uint64 kOLabelSorted = 0x0000000040000000ULL
 olabels sorted wrt < for each state.
constexpr uint64 kNotOLabelSorted = 0x0000000080000000ULL
 olabels not sorted wrt < for some state.
constexpr uint64 kWeighted = 0x0000000100000000ULL
 Non-trivial arc or final weights.
constexpr uint64 kUnweighted = 0x0000000200000000ULL
 Only trivial arc and final weights.
constexpr uint64 kCyclic = 0x0000000400000000ULL
 FST has cycles.
constexpr uint64 kAcyclic = 0x0000000800000000ULL
 FST has no cycles.
constexpr uint64 kInitialCyclic = 0x0000001000000000ULL
 FST has cycles containing the initial state.
constexpr uint64 kInitialAcyclic = 0x0000002000000000ULL
 FST has no cycles containing the initial state.
constexpr uint64 kTopSorted = 0x0000004000000000ULL
 FST is topologically sorted.
constexpr uint64 kNotTopSorted = 0x0000008000000000ULL
 FST is not topologically sorted.
constexpr uint64 kAccessible = 0x0000010000000000ULL
 All states reachable from the initial state.
constexpr uint64 kNotAccessible = 0x0000020000000000ULL
 Not all states reachable from the initial state.
constexpr uint64 kCoAccessible = 0x0000040000000000ULL
 All states can reach a final state.
constexpr uint64 kNotCoAccessible = 0x0000080000000000ULL
 Not all states can reach a final state.
constexpr uint64 kString = 0x0000100000000000ULL
constexpr uint64 kNotString = 0x0000200000000000ULL
 Not a string FST.
constexpr uint64 kWeightedCycles = 0x0000400000000000ULL
 FST has least one weighted cycle.
constexpr uint64 kUnweightedCycles = 0x0000800000000000ULL
 Only unweighted cycles.
constexpr uint64 kNullProperties
 COMPOSITE PROPERTIES.
constexpr uint64 kCopyProperties
 Properties that are preserved when an FST is copied.
constexpr uint64 kIntrinsicProperties
 Properties that are intrinsic to the FST.
constexpr uint64 kExtrinsicProperties = kError
 Properties that are (potentially) extrinsic to the FST.
constexpr uint64 kSetStartProperties
 Properties that are preserved when an FST start state is set.
constexpr uint64 kSetFinalProperties
 Properties that are preserved when an FST final weight is set.
constexpr uint64 kAddStateProperties
 Properties that are preserved when an FST state is added.
constexpr uint64 kAddArcProperties
 Properties that are preserved when an FST arc is added.
constexpr uint64 kSetArcProperties = kExpanded | kMutable | kError
 Properties that are preserved when an FST arc is set.
constexpr uint64 kDeleteStatesProperties
 Properties that are preserved when FST states are deleted.
constexpr uint64 kDeleteArcsProperties
 Properties that are preserved when FST arcs are deleted.
constexpr uint64 kStateSortProperties
 Properties that are preserved when an FST's states are reordered.
constexpr uint64 kArcSortProperties
 Properties that are preserved when an FST's arcs are reordered.
constexpr uint64 kILabelInvariantProperties
 Properties that are preserved when an FST's input labels are changed.
constexpr uint64 kOLabelInvariantProperties
 Properties that are preserved when an FST's output labels are changed.
constexpr uint64 kWeightInvariantProperties
constexpr uint64 kAddSuperFinalProperties
constexpr uint64 kRmSuperFinalProperties
constexpr uint64 kBinaryProperties = 0x0000000000000007ULL
 All binary properties.
constexpr uint64 kTrinaryProperties = 0x0000ffffffff0000ULL
 All trinary properties.
constexpr uint64 kPosTrinaryProperties
 COMPUTED PROPERTIES.
constexpr uint64 kNegTrinaryProperties
 2nd bit of trinary properties.
constexpr uint64 kFstProperties = kBinaryProperties | kTrinaryProperties
 All properties.
const char * PropertyNames []
 Property string names (indexed by bit position).
constexpr uint32 kPushWeights = 0x0001
constexpr uint32 kPushLabels = 0x0002
constexpr uint32 kPushRemoveTotalWeight = 0x0004
constexpr uint32 kPushRemoveCommonAffix = 0x0008
constexpr uint8 kReplaceSCCLeftLinear = 0x01
constexpr uint8 kReplaceSCCRightLinear = 0x02
constexpr uint8 kReplaceSCCNonTrivial = 0x04
constexpr int kSetEmpty = 0
 Label for the empty set.
constexpr int kSetUniv = -1
 Label for the universal set.
constexpr int kSetBad = -2
 Label for a non-set.
constexpr char kSetSeparator = '_'
 Label separator in sets.
constexpr int kStringInfinity = -1
 Label for the infinite string.
constexpr int kStringBad = -2
 Label for a non-string.
constexpr char kStringSeparator = '_'
 Label separator in strings.
constexpr float kDelta = 1.0F / 1024.0F
 CONSTANT DEFINITIONS.
constexpr uint64 kLeftSemiring = 0x0000000000000001ULL
 For all a, b, c: Times(c, Plus(a, b)) = Plus(Times(c, a), Times(c, b)).
constexpr uint64 kRightSemiring = 0x0000000000000002ULL
 For all a, b, c: Times(Plus(a, b), c) = Plus(Times(a, c), Times(b, c)).
constexpr uint64 kSemiring = kLeftSemiring | kRightSemiring
constexpr uint64 kCommutative = 0x0000000000000004ULL
 For all a, b: Times(a, b) = Times(b, a).
constexpr uint64 kIdempotent = 0x0000000000000008ULL
 For all a: Plus(a, a) = a.
constexpr uint64 kPath = 0x0000000000000010ULL
 For all a, b: Plus(a, b) = a or Plus(a, b) = b.
constexpr size_t kNumRandomWeights = 5
constexpr int32 kFstMagicNumber = 2125659606
 Identifies stream data as an FST (and its endianity).

Detailed Description

For optional argument declarations.

Scripting API support for StateIterator.

For RandArcSelection.

Major classes.

Scripting API support for EncodeMapper.

for all internal FST accessors.

for allocator<>

for ComposeOptions

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Definitions of 'scriptable' versions of compression operations, that is, those that can be called with FstClass-type arguments.

See comments in nlp/fst/script/script-impl.h for how the registration mechanism allows these to work with various arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Definitions of 'scriptable' versions of FAR operations, that is, those that can be called with FstClass-type arguments.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Definitions and functions for invoking and using Far main functions that support multiple and extensible arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Definitions of 'scriptable' versions of mpdt operations, that is, those that can be called with FstClass-type arguments.

See comments in nlp/fst/script/script-impl.h for how the registration mechanism allows these to work with various arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Definitions of 'scriptable' versions of pdt operations, that is, those that can be called with FstClass-type arguments.

See comments in nlp/fst/script/script-impl.h for how the registration mechanism allows these to work with various arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes to accumulate arc weights. Useful for weight lookahead.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

FST implementation class to attach an arbitrary object with a read/write method to an FST and its file representation. The FST is given a new type name.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to map over/transform arcs e.g., change semirings or implement project/invert. Consider using when operation does not change the number of arcs (except possibly superfinal arcs).

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Commonly used FST arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function objects to restrict which arcs are traversed in an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to sort arcs in an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes for representing a bijective mapping between an arbitrary entry of type T and a signed integral ID.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to compute the concatenative closure of an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

FST Class for memory-efficient representation of common types of FSTs: linear automata, acceptors, unweighted FSTs, ...

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to complement an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes for filtering the composition matches, e.g. for correct epsilon handling.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to compute the composition of two FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to compute the concatenation of two FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes and functions to remove unsuccessful paths from an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Simple concrete immutable FST whose states and arcs are each stored in single arrays. Google-only... ...Google-only

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to determinize an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Depth-first search visitation. See visit.h for more general search queue disciplines.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to compute the difference between two FSAs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to disambiguate an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

An FST implementation that allows non-destructive edit operations on an existing FST.

The EditFst class enables non-destructive edit operations on a wrapped ExpandedFst. The implementation uses copy-on-write semantics at the node level: if a user has an underlying fst on which he or she wants to perform a relatively small number of edits (read: mutations), then this implementation will copy the edited node to an internal MutableFst and perform any edits in situ on that copied node. This class supports all the methods of MutableFst except for DeleteStates(const std::vector<StateId> &); thus, new nodes may also be added, and one may add transitions from existing nodes of the wrapped fst to new nodes.

N.B.: The documentation for Fst::Copy(true) says that its behavior is undefined if invoked on an fst that has already been accessed. This class requires that the Fst implementation it wraps provides consistent, reliable behavior when its Copy(true) method is invoked, where consistent means the graph structure, graph properties and state numbering and do not change. VectorFst and CompactFst, for example, are both well-behaved in this regard.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to encode and decode an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function that implements epsilon-normalization.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function to test equality of two FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to determine the equivalence of two FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Generic FST augmented with state count-interface class definition.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Expectation semiring as described by Jason Eisner: See: doi=10.1.1.22.9398 Multiplex semiring operations and identities: One: <One, Zero> Zero: <Zero, Zero> Plus: <a1, b1> + <a2, b2> = < (a1 + a2) , (b1 + b2) > Times: <a1, b1> * <a2, b2> = < (a1 * a2) , [(a1 * b2) + (a2 * b1)] > Division: Undefined (currently)

Usually used to store the pair <probability, random_variable> so that ShortestDistance[Fst<ArcTpl<ExpectationWeight<P, V>>>] == < PosteriorProbability, Expected_Value[V] >

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Declarations of 'scriptable' versions of compression operations, that is, those that can be called with FstClass-type arguments.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Compresses and decompresses unweighted FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Generates a random FST according to a class-specific transition model.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Creates a finite-state archive from component FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Extracts component FSTs from an finite-state archive.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Scripting API support for FarReader and FarWriter.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Finite-State Transducer (FST) archive classes.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Convenience file for including all of the FAR operations, or registering them for new arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes and functions for registering and invoking FAR main functions that support multiple and extensible arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes and functions for registering and invoking Far main functions that support multiple and extensible arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

A generic (string,type) list file format.

This is a stripped-down version of STTable that does not support the Find() operation but that does support reading/writting from standard in/out.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

A generic string-to-type table file format.

This is not meant as a generalization of SSTable. This is more of a simple replacement for SSTable in order to provide an open-source implementation of the FAR format for the external version of the FST library.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Data structures for storing and looking up the actual feature weights.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes for building, storing and representing log-linear models as FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Compose an MPDT and an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Expands an MPDT to an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Prints information about an MPDT.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Common classes for Multi Pushdown Transducer (MPDT) expansion/traversal.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Convenience file for including all MPDT operations at once, and/or registering them for new arc types. For LabelClassPair, FstClassPair, and to detect any collisions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Definition of ReadLabelTriples based on ReadLabelPairs, like that in nlp/fst/lib/util.h for pairs, and similarly for WriteLabelTriples.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Reverses an MPDT.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library. This class is a bitstring storage class with an index that allows seeking to the Nth set or clear bit in time O(Log(N)) where N is the length of the bit vector. In addition, it allows counting set or clear bits over ranges in constant time.

This is accomplished by maintaining an "secondary" index of limited size in bits that maintains a running count of the number of bits set in each block of bitmap data. A block is defined as the number of uint64 values that can fit in the secondary index before an overflow occurs.

To handle overflows, a "primary" index containing a running count of bits set in each block is created using the type uint64.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

NgramFst implements a n-gram language model based upon the LOUDS data structure. Please refer to "Unary Data Structures for Language Models" http://research.google.com/pubs/archive/37218.pdf

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to store a collection of ordered (multi-)sets with elements of type T.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Composes a PDT and an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Expands a PDT to an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Prints information about a PDT.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Common classes for PDT parentheses.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Common classes for PDT expansion/traversal.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Convenience file for including all PDT operations at once, and/or registering them for new arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Recursively replaces FST arcs with other FSTs, returning a PDT.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions to find shortest paths in a PDT.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes to factor weights in an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes for storing filter state in various algorithms like composition.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Float weight set and associated semiring operation definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

This file contains declarations of classes in the Fst template library.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library. Generic class representing a globally-stored correspondence between objects of KeyType and EntryType.

KeyType must:

be such as can be stored as a key in a std::map<>. be concatenable with a const char* with the + operator (or you must subclass and redefine LoadEntryFromSharedObject)

EntryType must be default constructible.

The third template parameter should be the type of a subclass of this class (think CRTP). This is to allow GetRegister() to instantiate and return an object of the appropriate type.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Implementation of a heap as in STL, but allows tracking positions in heap using a key. The key can be used to do an in-place update of values in the heap.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

This library implements an unrestricted Thompson/Pike UTF-8 parser and serializer. UTF-8 is a restricted subset of this byte stream encoding. See http://en.wikipedia.org/wiki/UTF-8 for a good description of the encoding details.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to compute the intersection of two FSAs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to represent and operate on sets of intervals.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to invert an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function to test two FSTs are isomorphic, i.e., they are equal up to a state and arc re-ordering. FSTs should be deterministic when viewed as unweighted automata.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to determine if a non-epsilon label can be read as the first non-epsilon symbol along some path from a given state.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Lexicographic weight set and associated semiring operation definitions.

A lexicographic weight is a sequence of weights, each of which must have the path property and Times() must be (strongly) cancellative (for all a,b,c != Zero(): Times(c, a) = Times(c, b) => a = b, Times(a, c) = Times(b, c) => a = b). The + operation on two weights a and b is the lexicographically prior of a and b.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Google-compatibility locking declarations and inline definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Composition filters to support lookahead matchers, useful for improving composition efficiency with certain inputs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Compatibility file for old-style Map() functions and MapFst class that have been renamed to ArcMap (cf. StateMap).

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to add a matcher to an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes to allow matching labels leaving FST states.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

FST memory utilities.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to minimize an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Expanded FST augmented with mutators; interface class definition and mutable arc iterator interface.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Pair weight templated base class for weight classes that contain two weights (e.g. Product, Lexicographic).

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to create a partition of states.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Cartesian power weight semiring operation definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Product weight set and associated semiring operation definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to project an FST on to its domain or range.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

FST property bits.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions implementing pruning.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to reweight/push an FST, and utility functions to weigh and reweight an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes for various FST state queues with a unified interface.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Tests if two FSTS are equivalent by checking if random strings from one FST are transduced the same by both FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes and functions to generate random paths through an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

An FST implementation and base interface for delayed unions, concatenations, and closures.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes for registering derived FST for generic reading.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to relabel an FST (either on input or output).

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Utility classes for the recursive replacement of FSTs (RTNs).

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes for the recursive replacement of FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function to reweight an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes that implemement epsilon-removal.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function to remove of final states that have epsilon-only input arcs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library. Scripting API support for ArcIterator.

A call to Value() causes the underlying arc to be used to construct the associated ArcClass.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

std::pair and std::tuple are used for the arguments of FstClass operations.

If a function with a return value is required, use the WithReturnValue template as follows:

WithReturnValue<bool, std::tuple<...>>

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to draw a binary FST by producing a text file in dot format, a helper class to fstdraw.cc.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library. Classes to support "boxing" all existing types of FST arcs in a single FstClass which hides the arc types. This allows clients to load and work with FSTs without knowing the arc type. These classes are only recommended for use in high-level scripting applications. Most users should use the lower-level templated versions corresponding to these classes.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Forward declarations for the FST and FST script classes.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

The FST script interface permits users to interact with FSTs without knowing their arc type. It does this by mapping compile-time polymorphism (in the form of a arc-templated FST types) onto a shared virtual interface. It also supports arc extension via a DSO interface. Due to the overhead of virtual dispatch and registered function lookups, the script API is somewhat slower then library API provided by types like StdVectorFst, but has the advantage that it is designed not to crash (and to provide useful debugging information) upon common user errors like passing invalid indices or attempting comparison of incompatible FSTs. It is used both by the FST binaries and the Python extension.

This header includes all of the FST script functionality. Flag-to-enum parsers. Templates like Operation<> and Apply<>. Operations. This class is necessary because registering each of the operations separately overfills the stack, as there's so many of them.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Getters for converting command-line arguments into the appropriate enums or bitmasks, with the simplest ones defined as inline. For ComposeFilter. For DeterminizeType. For kEncodeLabels (etc.). For EpsNormalizeType. For ProjectType. For kPushWeights (etc.). For QueueType. For ClosureType. For ArcSortType. For MapType.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to compute various information about FSTs, a helper class for fstinfo.cc.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library. Holds methods and classes responsible for maintaining the register for FstClass arc types.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

This file defines the registration mechanism for new operations. These operations are designed to enable scripts to work with FST classes at a high level.

If you have a new arc type and want these operations to work with FSTs with that arc type, see below for the registration steps you must take.

These methods are only recommended for use in high-level scripting applications. Most users should use the lower-level templated versions corresponding to these.

If you have a new arc type you'd like these operations to work with, use the REGISTER_FST_OPERATIONS macro defined in fstscript.h.

If you have a custom operation you'd like to define, you need four components. In the following, assume you want to create a new operation with the signature

void Foo(const FstClass &ifst, MutableFstClass *ofst);

You need:

1) A way to bundle the args that your new Foo operation will take, as a single struct. The template structs in arg-packs.h provide a handy way to do this. In Foo's case, that might look like this:

using FooArgs = std::pair<const FstClass &, MutableFstClass *>;

Note: this package of args is going to be passed by non-const pointer.

2) A function template that is able to perform Foo, given the args and arc type. Yours might look like this:

template<class Arc> void Foo(FooArgs *args) { Pulls out the actual, arc-templated FSTs. const Fst<Arc> &ifst = std::get<0>(*args).GetFst<Arc>(); MutableFst<Arc> *ofst = std::get<1>(*args)->GetMutableFst<Arc>(); Actually perform Foo on ifst and ofst. }

3) a client-facing function for your operation. This would look like the following:

void Foo(const FstClass &ifst, MutableFstClass *ofst) { Check that the arc types of the FSTs match if (!ArcTypesMatch(ifst, *ofst, "Foo")) return; package the args FooArgs args(ifst, ofst); Finally, call the operation Apply<Operation<FooArgs>>("Foo", ifst->ArcType(), &args); }

The Apply<> function template takes care of the link between 2 and 3, provided you also have:

4) A registration for your new operation, on the arc types you care about. This can be provided easily by the REGISTER_FST_OPERATION macro in operations.h:

REGISTER_FST_OPERATION(Foo, StdArc, FooArgs); REGISTER_FST_OPERATION(Foo, MyArc, FooArgs); .. etc

That's it! Now when you call Foo(const FstClass &, MutableFstClass *), it dispatches (in #3) via the Apply<> function to the correct instantiation of the template function in #2. This file contains general-purpose templates which are used in the implementation of the operations.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Utilities for reading and writing textual strings representing states, labels, and weights and files specifying label-label pairs and potentials (state-weight pairs).

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Represents a generic weight in an FST; that is, represents a specific type of weight underneath while hiding that type from a client.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Weights consisting of sets (of integral Labels) and associated semiring operation definitions using intersect and union.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to find shortest distance in an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions to find shortest paths in an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

LogWeight along with sign information that represents the value X in the linear domain as <sign(X), -ln(|X|)>

The sign is a TropicalWeight: positive, TropicalWeight.Value() > 0.0, recommended value 1.0 negative, TropicalWeight.Value() <= 0.0, recommended value -1.0

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Cartesian power weight semiring operation definitions, using SparseTupleWeight as underlying representation.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Sparse version of tuple-weight, based on tuple-weight.h. Internally stores sparse key, value pairs in linked list. The default value element is the assumed value of unset keys. Internal singleton implementation that stores first key, value pair as a initialized member variable to avoid unnecessary allocation on heap. Use SparseTupleWeightIterator to iterate through the key,value pairs. Note: this does NOT iterate through the default value.

Sparse tuple weight set operation definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to map over/transform states e.g., sort transitions.

Consider using when operation does not change the number of states.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Class to determine whether a given (final) state can be reached from some other given state.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Classes for representing the mapping between state tuples and state IDs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function to sort states of an FST.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

String weight set and associated semiring operation definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Synchronize an FST with bounded delay.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Topological sort of FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Tuple weight set operation definitions.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Union-find algorithm for dense sets of non-negative integers, implemented using disjoint tree forests with rank heuristics and path compression.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Union weight set and associated semiring operation definitions.

TODO(riley): add in normalizer functor

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions and classes to compute the union of two FSTs.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Simple concrete, mutable FST whose states and arcs are stored in STL vectors.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Function to verify an FST's contents.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Queue-dependent visitation of finite-state transducers. See also dfs-visit.h.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Functions for updating property bits for various FST operations and string names of the properties.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

These classes are only recommended for use in high-level scripting applications. Most users should use the lower-level templated versions corresponding to these classes.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Regression test for FST classes.

See www.openfst.org for extensive documentation on this weighted finite-state transducer library.

Utility class for regression testing of FST weights.


Enumeration Type Documentation


Function Documentation

template<class Arc >
void fst::AccumulateStatesAndArcs ( const Fst< Arc > &  fst,
size_t *  nstate,
size_t *  narc,
size_t *  nfinal 
)
template<typename A >
uint64 fst::AddArcProperties ( uint64  inprops,
typename A::StateId  s,
const A &  arc,
const A *  prev_arc 
)
template<typename Arc >
uint64 fst::AddArcProperties ( uint64  inprops,
typename Arc::StateId  s,
const Arc &  arc,
const Arc *  prev_arc 
)

Gets the properties for the MutableFst::AddArc method.

Parameters:
inprops the current properties of the FST
s the ID of the state to which an arc is being added.
arc the arc being added to the state with the specified ID
prev_arc the previously-added (or "last") arc of state s, or nullptr if s currently has no arcs.

Definition at line 416 of file properties.h.

bool fst::AddAuxiliarySymbols ( const string &  prefix,
int64  start_label,
int64  nlabels,
SymbolTable *  syms 
)
uint64 fst::AddStateProperties ( uint64  inprops  )  [inline]
bool fst::AlignInput ( std::istream &  strm  ) 
bool fst::AlignOutput ( std::ostream &  strm  ) 
template<typename Label , StringType S>
bool fst::ApproxEqual ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2,
float  delta = kDelta 
) [inline]
template<class W1 , class W2 >
bool fst::ApproxEqual ( const PairWeight< W1, W2 > &  w1,
const PairWeight< W1, W2 > &  w2,
float  delta = kDelta 
) [inline]

Definition at line 111 of file pair-weight.h.

template<class W , size_t n>
bool fst::ApproxEqual ( const TupleWeight< W, n > &  w1,
const TupleWeight< W, n > &  w2,
float  delta = kDelta 
) [inline]

Definition at line 132 of file tuple-weight.h.

template<class W , class O >
bool fst::ApproxEqual ( const UnionWeight< W, O > &  w1,
const UnionWeight< W, O > &  w2,
float  delta = kDelta 
) [inline]

Requires union weight has been canonicalized.

Definition at line 346 of file union-weight.h.

template<class T >
bool fst::ApproxEqual ( const FloatWeightTpl< T > &  w1,
const FloatWeightTpl< T > &  w2,
float  delta = kDelta 
) [inline]

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

template<typename Label , SetType S>
bool fst::ApproxEqual ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2,
float  delta = kDelta 
) [inline]

Definition at line 288 of file set-weight.h.

template<class T >
bool fst::ApproxEqual ( const SignedLogWeightTpl< T > &  w1,
const SignedLogWeightTpl< T > &  w2,
float  delta = kDelta 
) [inline]

Definition at line 178 of file signed-log-weight.h.

template<class W , class K >
bool fst::ApproxEqual ( const SparsePowerWeight< W, K > &  w1,
const SparsePowerWeight< W, K > &  w2,
float  delta = kDelta 
) [inline]

Definition at line 174 of file sparse-power-weight.h.

template<class A , class B , class C >
void fst::ArcMap ( const Fst< A > &  ifst,
MutableFst< B > *  ofst,
mapper 
)
template<class A , class C >
void fst::ArcMap ( MutableFst< A > *  fst,
C *  mapper 
)

The ArcMapper interfaces defines how arcs and final weights are mapped. This is useful for implementing operations that do not change the number of arcs (expect possibly superfinal arcs).

template <class A, class B> class ArcMapper { public: using FromArc = A; using ToArc = B;

Maps an arc type FromArc to arc type ToArc. ToArc operator()(const FromArc &arc);

Specifies final action the mapper requires (see above). The mapper will be passed final weights as arcs of the form Arc(0, 0, weight, kNoStateId). MapFinalAction FinalAction() const;

Specifies input symbol table action the mapper requires (see above). MapSymbolsAction InputSymbolsAction() const;

Specifies output symbol table action the mapper requires (see above). MapSymbolsAction OutputSymbolsAction() const;

This specifies the known properties of an FST mapped by this mapper. It takes as argument the input FSTs's known properties. uint64 Properties(uint64 props) const; };

The ArcMap functions and classes below will use the FinalAction() method of the mapper to determine how to treat final weights, e.g., whether to add a superfinal state. They will use the Properties() method to set the result FST properties.

We include a various map versions below. One dimension of variation is whether the mapping mutates its input, writes to a new result FST, or is an on-the-fly FST. Another dimension is how we pass the mapper. We allow passing the mapper by pointer for cases that we need to change the state of the user's mapper. This is the case with the EncodeMapper, which is reused during decoding. We also include map versions that pass the mapper by value or const reference when this suffices. Maps an arc type A using a mapper function object C, passed by pointer. This version modifies its Fst input.

Definition at line 94 of file arc-map.h.

template<class A , class C >
void fst::ArcMap ( MutableFst< A > *  fst,
mapper 
)

Maps an arc type A using a mapper function object C, passed by value. This version modifies its FST input.

Definition at line 173 of file arc-map.h.

template<class A , class B , class C >
void fst::ArcMap ( const Fst< A > &  ifst,
MutableFst< B > *  ofst,
C *  mapper 
)

Maps an arc type A to an arc type B using mapper function object C, passed by pointer. This version writes the mapped input FST to an output MutableFst.

Definition at line 181 of file arc-map.h.

template<class Arc , class Compare >
void fst::ArcSort ( MutableFst< Arc > *  fst,
Compare  comp 
)

Sorts the arcs in an FST according to function object 'comp' of type Compare. This version modifies its input. Comparison function objects ILabelCompare and OLabelCompare are provided by the library. In general, Compare must meet the requirements for a comparison function object (e.g., similar to those used by std::sort). It must also have a member Properties(uint64) that specifies the known properties of the sorted FST; it takes as argument the input FST's known properties before the sort.

Complexity:

  • Time: O(v d log d)
  • Space: O(d)

where v = # of states and d = maximum out-degree.

Definition at line 87 of file arcsort.h.

template<class Dest , class Source >
Dest fst::bit_cast ( const Source &  source  )  [inline]
template<class F , class G >
void fst::Cast ( const F &  ,
G *   
)
template<class IFST , class OFST >
void fst::Cast ( const IFST &  ifst,
OFST *  ofst 
)

Converts FSTs by casting their implementations, where this makes sense (which excludes implementations with weight-dependent virtual methods). Must be a friend of the FST classes involved (currently the concrete FSTs: ConstFst, CompactFst, and VectorFst). This can only be safely used for arc types that have identical storage characteristics. As with an FST copy constructor and Copy() method, this is a constant time operation (but subject to copy-on-write if it is a MutableFst and modified).

Definition at line 929 of file fst.h.

template<class Arc >
uint64 fst::CheckProperties ( const Fst< Arc > &  fst,
uint64  check_mask,
uint64  test_mask 
)
template<class Arc >
void fst::Closure ( MutableFst< Arc > *  fst,
ClosureType  closure_type 
)

Computes the concatenative closure. This version modifies its MutableFst input. If an FST transduces string x to y with weight a, then its closure transduces x to y with weight a, xx to yy with weight Times(a, a), xxx to yyy with with Times(Times(a, a), a), etc. If closure_type == CLOSURE_STAR, then the empty string is transduced to itself with weight Weight::One() as well.

Complexity:

Time: O(V) Space: O(V)

where V is the number of states.

Definition at line 32 of file closure.h.

template<class Arc >
void fst::Closure ( RationalFst< Arc > *  fst,
ClosureType  closure_type 
)

Computes the concatenative closure. This version modifies its RationalFst input.

uint64 fst::ClosureProperties ( uint64  inprops,
bool  star,
bool  delayed 
)
SymbolTable * fst::CompactSymbolTable ( const SymbolTable &  syms  ) 
bool fst::CompatProperties ( uint64  props1,
uint64  props2 
) [inline]
bool fst::CompatSymbols ( const SymbolTable *  syms1,
const SymbolTable *  syms2,
bool  warning = true 
)
uint64 fst::ComplementProperties ( uint64  inprops  ) 
template<class Arc >
void fst::Compose ( const Fst< Arc > &  ifst1,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
const Fst< Arc > &  ifst2,
MutableFst< Arc > *  ofst,
const PdtComposeOptions &  opts = PdtComposeOptions() 
)
template<class Arc >
void fst::Compose ( const Fst< Arc > &  ifst1,
const Fst< Arc > &  ifst2,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
MutableFst< Arc > *  ofst,
const PdtComposeOptions &  opts = PdtComposeOptions() 
)

Composes an FST (1st arg) and pushdown transducer (PDT) encoded as an FST (2nd arg) with the result also a PDT encoded as an FST (3rd arg). In the PDTs, some transitions are labeled with open or close parentheses. To be interpreted as a PDT, the parens must balance on a path (see ExpandFst()). The open-close parenthesis label pairs are passed using the parens argument.

Definition at line 460 of file compose.h.

template<class Arc >
void fst::Compose ( const Fst< Arc > &  ifst1,
const Fst< Arc > &  ifst2,
MutableFst< Arc > *  ofst,
const ComposeOptions &  opts = ComposeOptions() 
)

Computes the composition of two transducers. This version writes the composed FST into a MutableFst. If FST1 transduces string x to y with weight a and FST2 transduces y to z with weight b, then their composition transduces string x to z with weight Times(x, z).

The output labels of the first transducer or the input labels of the second transducer must be sorted. The weights need to form a commutative semiring (valid for TropicalWeight and LogWeight).

Complexity:

Assuming the first FST is unsorted and the second is sorted:

Time: O(V1 V2 D1 (log D2 + M2)), Space: O(V1 V2 D1 M2)

where Vi = # of states, Di = maximum out-degree, and Mi is the maximum multiplicity, for the ith FST.

Caveats:

  • Compose trims its output.
  • The efficiency of composition can be strongly affected by several factors:
    • the choice of which transducer is sorted - prefer sorting the FST that has the greater average out-degree.
    • the amount of non-determinism
    • the presence and location of epsilon transitions - avoid epsilon transitions on the output side of the first transducer or the input side of the second transducer or prefer placing them later in a path since they delay matching and can introduce non-coaccessible states and transitions.

Definition at line 965 of file compose.h.

template<class Arc >
void fst::Compose ( const Fst< Arc > &  ifst1,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
const std::vector< typename Arc::Label > &  assignments,
const Fst< Arc > &  ifst2,
MutableFst< Arc > *  ofst,
const MPdtComposeOptions &  opts = MPdtComposeOptions() 
)

Composes multi-pushdown transducer (MPDT) encoded as an FST (1st arg) and an FST (2nd arg) with the result also an MPDT encoded as an FST (3rd arg). In theMPDTs, some transitions are labeled with open or close parentheses (and associated with a stack). To be interpreted as an MPDT, the parents on each stack must balance on a path (see MPdtExpand()). The open-close parenthesis label pairs are passed using the parens arguments, and the stack assignments are passed using the assignments argument.

Definition at line 226 of file compose.h.

template<class Arc >
void fst::Compose ( const Fst< Arc > &  ifst1,
const Fst< Arc > &  ifst2,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
const std::vector< typename Arc::Label > &  assignments,
MutableFst< Arc > *  ofst,
const MPdtComposeOptions &  opts = MPdtComposeOptions() 
)

Composes an FST (1st arg) and a multi-pushdown transducer (MPDT) encoded as an FST (2nd arg) with the result also an MPDT encoded as an FST (3rd arg). In the MPDTs, some transitions are labeled with open or close parentheses (and associated with a stack). To be interpreted as an MPDT, the parents on each stack must balance on a path (see MPdtExpand()). The open-close parenthesis label pairs are passed using the parens arguments, and the stack assignments are passed using the assignments argument.

Definition at line 250 of file compose.h.

uint64 fst::ComposeProperties ( uint64  inprops1,
uint64  inprops2 
)
template<class Arc >
void fst::Compress ( const Fst< Arc > &  fst,
std::ostream &  strm 
)
template<class Arc >
bool fst::Compress ( const Fst< Arc > &  fst,
const string &  file_name,
const bool  gzip = false 
)

Returns true on success.

Definition at line 817 of file compress.h.

template<class Arc >
uint64 fst::ComputeProperties ( const Fst< Arc > &  fst,
uint64  mask,
uint64 *  known,
bool  use_stored 
)

Computes FST property values defined in properties.h. The value of each property indicated in the mask will be determined and returned (these will never be unknown here). In the course of determining the properties specifically requested in the mask, certain other properties may be determined (those with little additional expense) and their values will be returned as well. The complete set of known properties (whether true or false) determined by this operation will be assigned to the the value pointed to by KNOWN. If 'use_stored' is true, pre-computed FST properties may be used when possible. 'mask & required_mask' is used to determine whether the stored propertoes can be used. This routine is seldom called directly; instead it is used to implement fst.Properties(mask, true).

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

template<class Arc >
Arc::Weight fst::ComputeTotalWeight ( const Fst< Arc > &  fst,
const std::vector< typename Arc::Weight > &  distance,
bool  reverse 
)
template<class Arc >
void fst::Concat ( const Fst< Arc > &  fst1,
MutableFst< Arc > *  fst2 
)

Computes the concatentation of two FSTs. This version modifies its MutableFst argument (in second position).

Complexity:

Time: O(V1 + E1) Space: O(V1 + E1)

where Vi is the number of states, and Ei is the number of arcs, of the ith FST.

Definition at line 92 of file concat.h.

template<class Arc >
void fst::Concat ( MutableFst< Arc > *  fst1,
const Fst< Arc > &  fst2 
)

Computes the concatenation (product) of two FSTs. If FST1 transduces string x to y with weight a and FST2 transduces string w to v with weight b, then their concatenation transduces string xw to yv with weight Times(a, b).

This version modifies its MutableFst argument (in first position).

Complexity:

Time: O(V1 + V2 + E2) Space: O(V1 + V2 + E2)

where Vi is the number of states, and Ei is the number of arcs, of the ith FST.

Definition at line 32 of file concat.h.

template<class Arc >
void fst::Concat ( const Fst< Arc > &  fst1,
RationalFst< Arc > *  fst2 
)

Computes the concatentation of two FSTs. This version modifies its RationalFst input (in second position).

template<class Arc >
void fst::Concat ( RationalFst< Arc > *  fst1,
const Fst< Arc > &  fst2 
)

Computes the concatentation of two FSTs. This version modifies its RationalFst input (in first position).

uint64 fst::ConcatProperties ( uint64  inprops1,
uint64  inprops2,
bool  delayed = false 
)
template<class Arc >
void fst::Condense ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
std::vector< typename Arc::StateId > *  scc 
)
template<class Arc >
void fst::Connect ( MutableFst< Arc > *  fst  ) 
template<class Arc >
Fst<Arc>* fst::Convert ( const Fst< Arc > &  fst,
const string &  fst_type 
)
void fst::ConvertToLegalCSymbol ( string *  s  ) 
template<class Arc >
Arc::StateId fst::CountArcs ( const Fst< Arc > &  fst  ) 
template<class Arc >
Arc::StateId fst::CountStates ( const Fst< Arc > &  fst  ) 
template<class Arc >
void fst::Decode ( MutableFst< Arc > *  fst,
const EncodeMapper< Arc > &  mapper 
) [inline]
template<class Arc >
void fst::Decompress ( std::istream &  strm,
const string &  source,
MutableFst< Arc > *  fst 
)
template<class Arc >
bool fst::Decompress ( const string &  file_name,
MutableFst< Arc > *  fst,
const bool  gzip = false 
)

Returns true on success.

Definition at line 866 of file compress.h.

uint64 fst::DeleteAllStatesProperties ( uint64  inprops,
uint64  staticProps 
) [inline]
uint64 fst::DeleteArcsProperties ( uint64  inprops  )  [inline]
uint64 fst::DeleteStatesProperties ( uint64  inprops  )  [inline]
template<class FST >
void fst::Destroy ( ArcIterator< FST > *  aiter,
MemoryPool< ArcIterator< FST >> *  pool 
)
template<class Arc >
void fst::Determinize ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
const DeterminizeOptions< Arc > &  opts = DeterminizeOptions<Arc>() 
)

Determinizes a weighted transducer. This version writes the determinized Fst to an output MutableFst. The result will be an equivalent FST that has the property that no state has two transitions with the same input label. For this algorithm, epsilon transitions are treated as regular symbols (cf. RmEpsilon).

The transducer must be functional. The weights must be (weakly) left divisible (valid for TropicalWeight and LogWeight).

Complexity:

Determinizable: exponential (polynomial in the size of the output) Non-determinizable: does not terminate

The determinizable automata include all unweighted and all acyclic input.

Definition at line 1054 of file determinize.h.

uint64 fst::DeterminizeProperties ( uint64  inprops,
bool  has_subsequential_label,
bool  distinct_psubsequential_labels 
)
template<class FST , class Visitor , class ArcFilter >
void fst::DfsVisit ( const FST &  fst,
Visitor *  visitor,
ArcFilter  filter,
bool  access_only = false 
)
template<class Arc , class Visitor >
void fst::DfsVisit ( const Fst< Arc > &  fst,
Visitor *  visitor 
)

Definition at line 198 of file dfs-visit.h.

template<class Arc >
void fst::Difference ( const Fst< Arc > &  ifst1,
const Fst< Arc > &  ifst2,
MutableFst< Arc > *  ofst,
const DifferenceOptions &  opts = DifferenceOptions() 
)

Computes the difference between two FSAs. This version writes the difference to an output MutableFst. Only strings that are in the first automaton but not in the second are retained in the result.

The first argument must be an acceptor; the second argument must be an unweighted, epsilon-free, deterministic acceptor. One of the arguments must be label-sorted.

Complexity: same as Compose.

Caveats: same as Compose.

Definition at line 151 of file difference.h.

template<typename Label , SetType S>
SetWeight<Label, S> fst::Difference ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]

Definition at line 403 of file set-weight.h.

template<class Arc >
void fst::Disambiguate ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
const DisambiguateOptions< Arc > &  opts = DisambiguateOptions<Arc>() 
)

namespace internal

Disambiguates a weighted FST. This version writes the disambiguated FST to an output MutableFst. The result will be an equivalent FST that has the property that there are not two distinct paths from the initial state to a final state with the same input labeling.

The weights must be (weakly) left divisible (valid for Tropical and LogWeight).

Complexity:

Disambiguable: exponential (polynomial in the size of the output). Non-disambiguable: does not terminate.

The disambiguable transducers include all automata and functional transducers that are unweighted or that are acyclic or that are unambiguous.

For more information, see:

Mohri, M. and Riley, M. 2015. On the disambiguation of weighted automata. In CIAA, pages 263-278.

Definition at line 555 of file disambiguate.h.

template<class W , class K >
SparsePowerWeight<W, K> fst::Divide ( const SparsePowerWeight< W, K > &  w1,
const W &  k,
DivideType  divide_type = DIVIDE_ANY 
) [inline]
template<class W1 , class W2 >
LexicographicWeight<W1, W2> fst::Divide ( const LexicographicWeight< W1, W2 > &  w,
const LexicographicWeight< W1, W2 > &  v,
DivideType  typ = DIVIDE_ANY 
) [inline]

Definition at line 129 of file lexicographic-weight.h.

template<typename Label , StringType S>
StringWeight<Label, S> fst::Divide ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2,
DivideType  divide_type 
) [inline]

Default is the restricted string semiring.

Definition at line 448 of file string-weight.h.

template<typename Label >
StringWeight<Label, STRING_LEFT> fst::Divide ( const StringWeight< Label, STRING_LEFT > &  w1,
const StringWeight< Label, STRING_LEFT > &  w2,
DivideType  divide_type 
) [inline]

Left division in the left string semiring.

Definition at line 466 of file string-weight.h.

template<typename Label >
StringWeight<Label, STRING_RIGHT> fst::Divide ( const StringWeight< Label, STRING_RIGHT > &  w1,
const StringWeight< Label, STRING_RIGHT > &  w2,
DivideType  divide_type 
) [inline]

Right division in the right string semiring.

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

template<class Label , class W , GallicType G>
GallicWeight<Label, W, G> fst::Divide ( const GallicWeight< Label, W, G > &  w,
const GallicWeight< Label, W, G > &  v,
DivideType  divide_type = DIVIDE_ANY 
) [inline]

Definition at line 635 of file string-weight.h.

template<class X1 , class X2 >
ExpectationWeight<X1, X2> fst::Divide ( const ExpectationWeight< X1, X2 > &  w1,
const ExpectationWeight< X1, X2 > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

Definition at line 113 of file expectation-weight.h.

template<class Label , class W >
GallicWeight<Label, W, GALLIC> fst::Divide ( const GallicWeight< Label, W, GALLIC > &  w1,
const GallicWeight< Label, W, GALLIC > &  w2,
DivideType  divide_type = DIVIDE_ANY 
) [inline]

(General) gallic divide.

Definition at line 776 of file string-weight.h.

template<class W , size_t n>
PowerWeight<W, n> fst::Divide ( const PowerWeight< W, n > &  w1,
const PowerWeight< W, n > &  w2,
DivideType  type = DIVIDE_ANY 
) [inline]

Semiring divide operation.

Definition at line 104 of file power-weight.h.

template<class W1 , class W2 >
ProductWeight<W1, W2> fst::Divide ( const ProductWeight< W1, W2 > &  w1,
const ProductWeight< W1, W2 > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

Definition at line 83 of file product-weight.h.

template<class W , class O >
UnionWeight<W, O> fst::Divide ( const UnionWeight< W, O > &  w1,
const UnionWeight< W, O > &  w2,
DivideType  typ 
) [inline]

Definition at line 447 of file union-weight.h.

template<class T >
TropicalWeightTpl<T> fst::Divide ( const TropicalWeightTpl< T > &  w1,
const TropicalWeightTpl< T > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

TropicalWeightTpl<float> fst::Divide ( const TropicalWeightTpl< float > &  w1,
const TropicalWeightTpl< float > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

TropicalWeightTpl<double> fst::Divide ( const TropicalWeightTpl< double > &  w1,
const TropicalWeightTpl< double > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

template<class T >
LogWeightTpl<T> fst::Divide ( const LogWeightTpl< T > &  w1,
const LogWeightTpl< T > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

LogWeightTpl<float> fst::Divide ( const LogWeightTpl< float > &  w1,
const LogWeightTpl< float > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

LogWeightTpl<double> fst::Divide ( const LogWeightTpl< double > &  w1,
const LogWeightTpl< double > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

template<class T >
MinMaxWeightTpl<T> fst::Divide ( const MinMaxWeightTpl< T > &  w1,
const MinMaxWeightTpl< T > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

Defined only for special cases.

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

MinMaxWeightTpl<double> fst::Divide ( const MinMaxWeightTpl< double > &  w1,
const MinMaxWeightTpl< double > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

MinMaxWeightTpl<float> fst::Divide ( const MinMaxWeightTpl< float > &  w1,
const MinMaxWeightTpl< float > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

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

template<typename Label , SetType S>
SetWeight<Label, S> fst::Divide ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2,
DivideType  divide_type = DIVIDE_ANY 
) [inline]

Divide = Difference.

Definition at line 509 of file set-weight.h.

template<typename Label >
SetWeight<Label, SET_UNION_INTERSECT> fst::Divide ( const SetWeight< Label, SET_UNION_INTERSECT > &  w1,
const SetWeight< Label, SET_UNION_INTERSECT > &  w2,
DivideType  divide_type = DIVIDE_ANY 
) [inline]

Divide = dividend (or the universal set if the dividend == divisor).

Definition at line 518 of file set-weight.h.

template<typename Label >
SetWeight<Label, SET_BOOLEAN> fst::Divide ( const SetWeight< Label, SET_BOOLEAN > &  w1,
const SetWeight< Label, SET_BOOLEAN > &  w2,
DivideType  divide_type = DIVIDE_ANY 
) [inline]

Divide = Or Not.

Definition at line 530 of file set-weight.h.

template<class T >
SignedLogWeightTpl<T> fst::Divide ( const SignedLogWeightTpl< T > &  w1,
const SignedLogWeightTpl< T > &  w2,
DivideType  typ = DIVIDE_ANY 
) [inline]

Definition at line 155 of file signed-log-weight.h.

template<class W , class K >
SparsePowerWeight<W, K> fst::Divide ( const SparsePowerWeight< W, K > &  w1,
const SparsePowerWeight< W, K > &  w2,
DivideType  type = DIVIDE_ANY 
) [inline]

Semimodule divide operation.

Definition at line 152 of file sparse-power-weight.h.

template<typename Label , StringType S>
StringWeight<Label, S> fst::DivideLeft ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2 
) [inline]
template<typename Label , StringType S>
StringWeight<Label, S> fst::DivideRight ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2 
) [inline]
template<class W , size_t n>
W fst::DotProduct ( const PowerWeight< W, n > &  w1,
const PowerWeight< W, n > &  w2 
) [inline]
template<class W , class K >
const W& fst::DotProduct ( const SparsePowerWeight< W, K > &  w1,
const SparsePowerWeight< W, K > &  w2 
) [inline]

Semimodule dot product operation.

Definition at line 163 of file sparse-power-weight.h.

template<typename To , typename From >
To fst::down_cast ( From *  f  )  [inline]
template<class Arc >
void fst::Encode ( MutableFst< Arc > *  fst,
EncodeMapper< Arc > *  mapper 
) [inline]
bool fst::EpsilonOnInput ( ReplaceLabelType  label_type  )  [inline]
bool fst::EpsilonOnOutput ( ReplaceLabelType  label_type  )  [inline]
template<class Arc >
void fst::EpsNormalize ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
EpsNormalizeType  type = EPS_NORM_INPUT 
)
template<class Arc , GallicType G>
void fst::EpsNormalize ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
EpsNormalizeType  type 
)

Same as above, expect allows specifying explicitely the gallic weight type.

Definition at line 39 of file epsnormalize.h.

template<class Arc >
bool fst::Equal ( const Fst< Arc > &  fst1,
const Fst< Arc > &  fst2,
float  delta = kDelta,
uint32  etype = kEqualFsts 
)

Tests if two Fsts have the same states and arcs in the same order (when etype & kEqualFst). Also optional checks equality of Fst types (etype & kEqualFstTypes) and compatibility of stored properties (etype & kEqualCompatProperties) and of symbol tables (etype & kEqualCompatSymbols).

Definition at line 30 of file equal.h.

template<class Arc >
bool fst::Equivalent ( const Fst< Arc > &  fst1,
const Fst< Arc > &  fst2,
double  delta = kDelta,
bool *  error = nullptr 
)
template<class Arc >
void fst::Expand ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
const std::vector< typename Arc::Label > &  assignments,
MutableFst< Arc > *  ofst,
const MPdtExpandOptions &  opts 
)
template<class Arc >
void fst::Expand ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
const std::vector< typename Arc::Label > &  assignments,
MutableFst< Arc > *  ofst,
bool  connect = true,
bool  keep_parentheses = false 
)

Expands a multi-pushdown transducer (MPDT) encoded as an FST into an FST. This version writes the expanded PDT to a mutable FST. In the MPDT, some transitions are labeled with open or close parentheses. To be interpreted as an MPDT, the parens for each stack must balance on a path. The open-close parenthesis label pair sets are passed using the parens argument, and the assignment of those pairs to stacks is passed using the assignments argument. The expansion enforces the parenthesis constraints. The MPDT must be expandable as an FST.

Definition at line 323 of file expand.h.

template<class Arc >
void fst::Expand ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
MutableFst< Arc > *  ofst,
const PdtExpandOptions< Arc > &  opts 
)

Expands a pushdown transducer (PDT) encoded as an FST into an FST. This version writes the expanded PDT to a mutable FST. In the PDT, some transitions are labeled with open or close parentheses. To be interpreted as a PDT, the parens must balance on a path. The open-close parenthesis label pairs are passed using the parens argument. Expansion enforces the parenthesis constraints. The PDT must be expandable as an FST.

Definition at line 899 of file expand.h.

template<class Arc >
void fst::Expand ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
MutableFst< Arc > *  ofst,
bool  connect = true,
bool  keep_parentheses = false 
)

Expands a pushdown transducer (PDT) encoded as an FST into an FST. This version writes the expanded PDT result to a mutable FST. In the PDT, some transitions are labeled with open or close parentheses. To be interpreted as a PDT, the parens must balance on a path. The open-close parenthesis label pairs are passed using the parents argument. Expansion enforces the parenthesis constraints. The PDT must be expandable as an FST.

Definition at line 923 of file expand.h.

uint64 fst::FactorWeightProperties ( uint64  inprops  ) 
template<class Arc >
void fst::FarCompileStrings ( const std::vector< string > &  in_fnames,
const string &  out_fname,
const string &  fst_type,
const FarType &  far_type,
int32  generate_keys,
FarEntryType  fet,
FarTokenType  tt,
const string &  symbols_fname,
const string &  unknown_symbol,
bool  keep_symbols,
bool  initial_symbols,
bool  allow_negative_labels,
const string &  key_prefix,
const string &  key_suffix 
)
template<class Arc >
void fst::FarCreate ( const std::vector< string > &  in_fnames,
const string &  out_fname,
const int32  generate_keys,
const FarType &  far_type,
const string &  key_prefix,
const string &  key_suffix 
)
template<class Arc >
bool fst::FarEqual ( const string &  filename1,
const string &  filename2,
float  delta = kDelta,
const string &  begin_key = string(),
const string &  end_key = string() 
)
template<class Arc >
void fst::FarExtract ( const std::vector< string > &  ifilenames,
int32  generate_filenames,
const string &  keys,
const string &  key_separator,
const string &  range_delimiter,
const string &  filename_prefix,
const string &  filename_suffix 
)
template<class Arc >
void fst::FarInfo ( const std::vector< string > &  filenames,
const string &  begin_key,
const string &  end_key,
const bool  list_fsts 
)
template<class Arc >
bool fst::FarIsomorphic ( const string &  filename1,
const string &  filename2,
float  delta = kDelta,
const string &  begin_key = string(),
const string &  end_key = string() 
)
template<class Arc >
void fst::FarPrintStrings ( const std::vector< string > &  ifilenames,
FarEntryType  entry_type,
FarTokenType  far_token_type,
const string &  begin_key,
const string &  end_key,
bool  print_key,
bool  print_weight,
const string &  symbols_fname,
bool  initial_symbols,
int32  generate_filenames,
const string &  filename_prefix,
const string &  filename_suffix 
)
template<class Arc >
void fst::FarWriteFst ( const Fst< Arc > *  fst,
string  key,
string *  okey,
int *  nrep,
int32  generate_filenames,
int  i,
const string &  filename_prefix,
const string &  filename_suffix 
) [inline]
SymbolTable * fst::FstReadSymbols ( const string &  filename,
bool  input 
)

Read the symbol table from any Fst::Read()able file, without loading the corresponding Fst. Returns nullptr if the Fst does not contain a symbol table or the symbol table cannot be read.

Definition at line 75 of file symbol-table-ops.cc.

template<class Arc >
void fst::FstToString ( const Fst< Arc > &  fst,
string *  result 
)
template<class Arc >
void fst::FstToString ( const Fst< Arc > &  fst,
string *  result,
const FstWriteOptions &  options 
)

Definition at line 945 of file fst.h.

constexpr StringType fst::GallicStringType ( GallicType  g  ) 
template<class Arc >
void fst::GetFarInfo ( const std::vector< string > &  filenames,
const string &  begin_key,
const string &  end_key,
const bool  list_fsts,
FarInfoData *  far_info 
)
string fst::GetFarTypeString ( FarType  type  ) 

namespace script

template<class A >
A::Label fst::GuessStartOrEnd ( std::vector< typename A::Label > *  sequence,
typename A::Label  boundary 
)
template<typename Label , SetType S>
SetWeight<Label, S> fst::Intersect ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]
template<class Arc >
void fst::Intersect ( const Fst< Arc > &  ifst1,
const Fst< Arc > &  ifst2,
MutableFst< Arc > *  ofst,
const IntersectOptions &  opts = IntersectOptions() 
)

Computes the intersection (Hadamard product) of two FSAs. This version writes the intersection to an output MurableFst. Only strings that are in both automata are retained in the result.

The two arguments must be acceptors. One of the arguments must be label-sorted.

Complexity: same as Compose.

Caveats: same as Compose.

Definition at line 127 of file intersect.h.

template<class Arc >
void fst::Invert ( MutableFst< Arc > *  fst  )  [inline]
uint64 fst::InvertProperties ( uint64  inprops  ) 
bool fst::IsFst ( const string &  filename  )  [inline]
bool fst::IsFstHeader ( std::istream &  strm,
const string &  source 
)
template<class Arc >
bool fst::Isomorphic ( const Fst< Arc > &  fst1,
const Fst< Arc > &  fst2,
float  delta = kDelta 
)
bool fst::IsSTList ( const string &  filename  ) 
bool fst::IsSTTable ( const string &  filename  ) 
template<class Iterator >
string fst::JoinLabels ( Iterator  begin,
Iterator  end,
const SymbolTable *  syms 
)
template<class Label >
string fst::JoinLabels ( const std::vector< Label > &  labels,
const SymbolTable *  syms 
)

Definition at line 1030 of file linear-fst-data-builder.h.

int fst::KeySize ( const char *  filename  ) 

Computes the minimal length required to encode each line number as a decimal number.

uint64 fst::KnownProperties ( uint64  props  )  [inline]
template<class Label >
bool fst::LabelsToUTF8String ( const std::vector< Label > &  labels,
string *  str 
)
template<class A >
void fst::LogLinearApply ( const Fst< A > &  ifst,
const Fst< A > &  lfst,
MutableFst< A > *  ofst,
bool  normalize = true 
)
template<class A , class B >
void fst::LogLinearApply ( const Fst< A > &  ifst,
const Fst< A > &  lfst,
MutableFst< A > *  ofst,
bool  normalize = true 
)

This version gives finer control over the arc type (`B`) to be used in normalization. `B` is an arc type with log weight (e.g. `LogArc` or `Log64Arc`).

Definition at line 45 of file loglinear-apply.h.

template<class Arc >
void fst::LookAheadCompose ( const Fst< Arc > &  ifst1,
const Fst< Arc > &  ifst2,
MutableFst< Arc > *  ofst 
)
void fst::LookAheadCompose ( const Fst< StdArc > &  ifst1,
const Fst< StdArc > &  ifst2,
MutableFst< StdArc > *  ofst 
)

Specialized and epsilon olabel acyclic - lookahead.

Definition at line 54 of file algo_test.h.

template<class Matcher1 , class Matcher2 >
MatchType fst::LookAheadMatchType ( const Matcher1 &  m1,
const Matcher2 &  m2 
)
template<class Arc >
MatchType fst::LookAheadMatchType ( const Fst< Arc > &  fst1,
const Fst< Arc > &  fst2 
)

Identifies and verifies the capabilities of the matcher to be used for lookahead with the composition filters below. This version uses the FST's default matchers.

Definition at line 47 of file lookahead-filter.h.

template<class A , class C >
void fst::Map ( MutableFst< A > *  fst,
C *  mapper 
)
template<class A , class C >
void fst::Map ( MutableFst< A > *  fst,
mapper 
)

Definition at line 22 of file map.h.

template<class A , class B , class C >
void fst::Map ( const Fst< A > &  ifst,
MutableFst< B > *  ofst,
C *  mapper 
)

Definition at line 27 of file map.h.

template<class A , class B , class C >
void fst::Map ( const Fst< A > &  ifst,
MutableFst< B > *  ofst,
mapper 
)

Definition at line 32 of file map.h.

SymbolTable * fst::MergeSymbolTable ( const SymbolTable &  left,
const SymbolTable &  right,
bool *  right_relabel_output = nullptr 
)

Merges two SymbolTables, all symbols from left will be merged into right with the same ids. Symbols in right that have conflicting ids with those in left will be assigned to value assigned from the left SymbolTable. The returned symbol table will never modify symbol assignments from the left side, but may do so on the right. If right_relabel_output is non-NULL, it will be assigned true if the symbols from the right table needed to be reassigned. A potential use case is to Compose two Fst's that have different symbol tables. You can reconcile them in the following way: Fst<Arc> a, b; bool relabel; std::unique_ptr<SymbolTable> bnew(MergeSymbolTable(a.OutputSymbols(), b.InputSymbols(), &relabel); if (relabel) { Relabel(b, bnew.get(), nullptr); } b.SetInputSymbols(bnew);

Definition at line 11 of file symbol-table-ops.cc.

template<class Arc >
void fst::Minimize ( MutableFst< Arc > *  fst,
MutableFst< Arc > *  sfst = nullptr,
float  delta = kDelta,
bool  allow_nondet = false 
)
template<class T >
SignedLogWeightTpl<T> fst::Minus ( const SignedLogWeightTpl< T > &  w1,
const SignedLogWeightTpl< T > &  w2 
) [inline]
uint64 fst::MPdtExpandProperties ( uint64  inprops  )  [inline]
template<class Result , class RNG >
void fst::OneMultinomialSample ( const std::vector< double > &  probs,
size_t  num_to_sample,
Result *  result,
RNG *  rng 
)
template<class W , class K >
bool fst::operator!= ( const SparseTupleWeight< W, K > &  w1,
const SparseTupleWeight< W, K > &  w2 
) [inline]
template<typename Label , StringType S>
bool fst::operator!= ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2 
) [inline]

Definition at line 280 of file string-weight.h.

template<typename T , typename U >
bool fst::operator!= ( const BlockAllocator< T > &  alloc1,
const BlockAllocator< U > &  alloc2 
)

Definition at line 284 of file memory.h.

template<typename T , typename U >
bool fst::operator!= ( const PoolAllocator< T > &  alloc1,
const PoolAllocator< U > &  alloc2 
)

Definition at line 412 of file memory.h.

template<class W1 , class W2 >
bool fst::operator!= ( const PairWeight< W1, W2 > &  w1,
const PairWeight< W1, W2 > &  w2 
) [inline]

Definition at line 105 of file pair-weight.h.

template<class W , size_t n>
bool fst::operator!= ( const TupleWeight< W, n > &  w1,
const TupleWeight< W, n > &  w2 
) [inline]

Definition at line 123 of file tuple-weight.h.

template<class W , class O >
bool fst::operator!= ( const UnionWeight< W, O > &  w1,
const UnionWeight< W, O > &  w2 
) [inline]

Requires union weight has been canonicalized.

Definition at line 339 of file union-weight.h.

template<class T >
bool fst::operator!= ( const FloatWeightTpl< T > &  w1,
const FloatWeightTpl< T > &  w2 
) [inline]

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

bool fst::operator!= ( const FloatWeightTpl< double > &  w1,
const FloatWeightTpl< double > &  w2 
) [inline]

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

bool fst::operator!= ( const FloatWeightTpl< float > &  w1,
const FloatWeightTpl< float > &  w2 
) [inline]

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

template<typename Label , SetType S>
bool fst::operator!= ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]

Definition at line 282 of file set-weight.h.

template<typename T , class Store >
std::ostream& fst::operator<< ( std::ostream &  strm,
const IntervalSet< T, Store > &  s 
)
template<class W , class K >
std::ostream& fst::operator<< ( std::ostream &  strm,
const SparseTupleWeight< W, K > &  weight 
) [inline]

Definition at line 377 of file sparse-tuple-weight.h.

template<typename Label , StringType S>
std::ostream& fst::operator<< ( std::ostream &  strm,
const StringWeight< Label, S > &  weight 
) [inline]

Definition at line 293 of file string-weight.h.

template<class W1 , class W2 >
std::ostream& fst::operator<< ( std::ostream &  strm,
const PairWeight< W1, W2 > &  weight 
) [inline]

Definition at line 118 of file pair-weight.h.

template<class W , size_t n>
std::ostream& fst::operator<< ( std::ostream &  strm,
const TupleWeight< W, n > &  w 
) [inline]

Definition at line 141 of file tuple-weight.h.

template<class W , class O >
std::ostream& fst::operator<< ( std::ostream &  ostrm,
const UnionWeight< W, O > &  weight 
) [inline]

Definition at line 358 of file union-weight.h.

template<class T >
std::ostream& fst::operator<< ( std::ostream &  strm,
const FloatWeightTpl< T > &  w 
) [inline]

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

template<typename Label , SetType S>
std::ostream& fst::operator<< ( std::ostream &  strm,
const SetWeight< Label, S > &  weight 
) [inline]

Definition at line 295 of file set-weight.h.

template<class W , class K >
bool fst::operator== ( const SparseTupleWeight< W, K > &  w1,
const SparseTupleWeight< W, K > &  w2 
) [inline]
template<typename T , typename U >
bool fst::operator== ( const BlockAllocator< T > &  alloc1,
const BlockAllocator< U > &  alloc2 
)

Definition at line 278 of file memory.h.

template<typename T , typename U >
bool fst::operator== ( const PoolAllocator< T > &  alloc1,
const PoolAllocator< U > &  alloc2 
)

Definition at line 406 of file memory.h.

template<class W1 , class W2 >
bool fst::operator== ( const PairWeight< W1, W2 > &  w1,
const PairWeight< W1, W2 > &  w2 
) [inline]

Definition at line 99 of file pair-weight.h.

template<class W , size_t n>
bool fst::operator== ( const TupleWeight< W, n > &  w1,
const TupleWeight< W, n > &  w2 
) [inline]

Definition at line 114 of file tuple-weight.h.

template<class W , class O >
bool fst::operator== ( const UnionWeight< W, O > &  w1,
const UnionWeight< W, O > &  w2 
) [inline]

Requires union weight has been canonicalized.

Definition at line 326 of file union-weight.h.

template<class T >
bool fst::operator== ( const FloatWeightTpl< T > &  w1,
const FloatWeightTpl< T > &  w2 
) [inline]

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

bool fst::operator== ( const FloatWeightTpl< double > &  w1,
const FloatWeightTpl< double > &  w2 
) [inline]

These seemingly unnecessary overloads are actually needed to make comparisons like FloatWeightTpl<float> == float compile. If only the templated version exists, the FloatWeightTpl<float>(float) conversion won't be found.

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

bool fst::operator== ( const FloatWeightTpl< float > &  w1,
const FloatWeightTpl< float > &  w2 
) [inline]

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

template<typename Label , StringType S>
bool fst::operator== ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2 
) [inline]

Definition at line 267 of file string-weight.h.

template<class StateId , class PrefixId >
bool fst::operator== ( const ReplaceStateTuple< StateId, PrefixId > &  x,
const ReplaceStateTuple< StateId, PrefixId > &  y 
) [inline]

Equality of replace state tuples.

Definition at line 79 of file replace.h.

template<class Label , class StateId >
bool fst::operator== ( const ReplaceStackPrefix< Label, StateId > &  x,
const ReplaceStackPrefix< Label, StateId > &  y 
) [inline]

Equality stack prefix classes.

Definition at line 163 of file replace.h.

template<typename Label >
bool fst::operator== ( const SetWeight< Label, SET_BOOLEAN > &  w1,
const SetWeight< Label, SET_BOOLEAN > &  w2 
) [inline]

Boolean ==.

Definition at line 267 of file set-weight.h.

template<typename Label , SetType S>
bool fst::operator== ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]

Default ==.

Definition at line 253 of file set-weight.h.

template<typename S , typename K >
bool fst::operator== ( const PdtStateTuple< S, K > &  x,
const PdtStateTuple< S, K > &  y 
) [inline]

Equality of PDT state tuples.

Definition at line 133 of file pdt.h.

template<class T >
bool fst::operator== ( const SignedLogWeightTpl< T > &  w1,
const SignedLogWeightTpl< T > &  w2 
) [inline]

Definition at line 191 of file signed-log-weight.h.

template<class W , class K >
std::istream& fst::operator>> ( std::istream &  strm,
SparseTupleWeight< W, K > &  weight 
) [inline]
template<typename Label , StringType S>
std::istream& fst::operator>> ( std::istream &  strm,
StringWeight< Label, S > &  weight 
) [inline]

Definition at line 312 of file string-weight.h.

template<class W1 , class W2 >
std::istream& fst::operator>> ( std::istream &  strm,
PairWeight< W1, W2 > &  weight 
) [inline]

Definition at line 129 of file pair-weight.h.

template<class W , size_t n>
std::istream& fst::operator>> ( std::istream &  strm,
TupleWeight< W, n > &  w 
) [inline]

Definition at line 151 of file tuple-weight.h.

template<class W , class O >
std::istream& fst::operator>> ( std::istream &  istrm,
UnionWeight< W, O > &  weight 
) [inline]

Definition at line 375 of file union-weight.h.

template<class T >
std::istream& fst::operator>> ( std::istream &  strm,
FloatWeightTpl< T > &  w 
) [inline]

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

template<typename Label , SetType S>
std::istream& fst::operator>> ( std::istream &  strm,
SetWeight< Label, S > &  weight 
) [inline]

Definition at line 314 of file set-weight.h.

template<typename Label >
SetWeight<Label, SET_INTERSECT_UNION_RESTRICT> fst::Plus ( const SetWeight< Label, SET_INTERSECT_UNION_RESTRICT > &  w1,
const SetWeight< Label, SET_INTERSECT_UNION_RESTRICT > &  w2 
) [inline]
template<typename Label , StringType S>
StringWeight<Label, S> fst::Plus ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2 
) [inline]

Default is for the restricted string semiring. String equality is required (for non-Zero() input). The restriction is used (e.g., in determinization) to ensure the input is functional.

Definition at line 340 of file string-weight.h.

template<typename Label >
StringWeight<Label, STRING_LEFT> fst::Plus ( const StringWeight< Label, STRING_LEFT > &  w1,
const StringWeight< Label, STRING_LEFT > &  w2 
) [inline]

Longest common prefix for left string semiring.

Definition at line 357 of file string-weight.h.

template<class X1 , class X2 >
ExpectationWeight<X1, X2> fst::Plus ( const ExpectationWeight< X1, X2 > &  w1,
const ExpectationWeight< X1, X2 > &  w2 
) [inline]

Definition at line 98 of file expectation-weight.h.

template<class Label , class W , GallicType G>
GallicWeight<Label, W, G> fst::Plus ( const GallicWeight< Label, W, G > &  w,
const GallicWeight< Label, W, G > &  v 
) [inline]

Default plus.

Definition at line 612 of file string-weight.h.

template<class W1 , class W2 >
LexicographicWeight<W1, W2> fst::Plus ( const LexicographicWeight< W1, W2 > &  w,
const LexicographicWeight< W1, W2 > &  v 
) [inline]

Definition at line 107 of file lexicographic-weight.h.

template<class Label , class W >
GallicWeight<Label, W, GALLIC_MIN> fst::Plus ( const GallicWeight< Label, W, GALLIC_MIN > &  w1,
const GallicWeight< Label, W, GALLIC_MIN > &  w2 
) [inline]

Min gallic plus.

Definition at line 620 of file string-weight.h.

template<class W , size_t n>
PowerWeight<W, n> fst::Plus ( const PowerWeight< W, n > &  w1,
const PowerWeight< W, n > &  w2 
) [inline]

Semiring plus operation.

Definition at line 82 of file power-weight.h.

template<class W , class O >
UnionWeight<W, O> fst::Plus ( const UnionWeight< W, O > &  w1,
const UnionWeight< W, O > &  w2 
) [inline]

Definition at line 400 of file union-weight.h.

template<class T >
TropicalWeightTpl<T> fst::Plus ( const TropicalWeightTpl< T > &  w1,
const TropicalWeightTpl< T > &  w2 
) [inline]

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

TropicalWeightTpl<float> fst::Plus ( const TropicalWeightTpl< float > &  w1,
const TropicalWeightTpl< float > &  w2 
) [inline]

See comment at operator==(FloatWeightTpl<float>, FloatWeightTpl<float>) for why these overloads are present.

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

TropicalWeightTpl<double> fst::Plus ( const TropicalWeightTpl< double > &  w1,
const TropicalWeightTpl< double > &  w2 
) [inline]

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

template<typename Label >
StringWeight<Label, STRING_RIGHT> fst::Plus ( const StringWeight< Label, STRING_RIGHT > &  w1,
const StringWeight< Label, STRING_RIGHT > &  w2 
) [inline]

Longest common suffix for right string semiring.

Definition at line 376 of file string-weight.h.

template<class T >
LogWeightTpl<T> fst::Plus ( const LogWeightTpl< T > &  w1,
const LogWeightTpl< T > &  w2 
) [inline]

namespace internal

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

template<class W1 , class W2 >
ProductWeight<W1, W2> fst::Plus ( const ProductWeight< W1, W2 > &  w1,
const ProductWeight< W1, W2 > &  w2 
) [inline]

Definition at line 69 of file product-weight.h.

LogWeightTpl<float> fst::Plus ( const LogWeightTpl< float > &  w1,
const LogWeightTpl< float > &  w2 
) [inline]

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

LogWeightTpl<double> fst::Plus ( const LogWeightTpl< double > &  w1,
const LogWeightTpl< double > &  w2 
) [inline]

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

template<class T >
MinMaxWeightTpl<T> fst::Plus ( const MinMaxWeightTpl< T > &  w1,
const MinMaxWeightTpl< T > &  w2 
) [inline]

Min.

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

MinMaxWeightTpl<float> fst::Plus ( const MinMaxWeightTpl< float > &  w1,
const MinMaxWeightTpl< float > &  w2 
) [inline]

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

MinMaxWeightTpl<double> fst::Plus ( const MinMaxWeightTpl< double > &  w1,
const MinMaxWeightTpl< double > &  w2 
) [inline]

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

template<typename Label , SetType S>
SetWeight<Label, S> fst::Plus ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]

Default: Plus = Intersect.

Definition at line 434 of file set-weight.h.

template<typename Label >
SetWeight<Label, SET_UNION_INTERSECT> fst::Plus ( const SetWeight< Label, SET_UNION_INTERSECT > &  w1,
const SetWeight< Label, SET_UNION_INTERSECT > &  w2 
) [inline]

Plus = Union.

Definition at line 442 of file set-weight.h.

template<typename Label >
SetWeight<Label, SET_BOOLEAN> fst::Plus ( const SetWeight< Label, SET_BOOLEAN > &  w1,
const SetWeight< Label, SET_BOOLEAN > &  w2 
) [inline]

Plus = Or.

Definition at line 470 of file set-weight.h.

template<class T >
SignedLogWeightTpl<T> fst::Plus ( const SignedLogWeightTpl< T > &  w1,
const SignedLogWeightTpl< T > &  w2 
) [inline]

Definition at line 92 of file signed-log-weight.h.

template<class Label , class W >
GallicWeight<Label, W, GALLIC> fst::Plus ( const GallicWeight< Label, W, GALLIC > &  w1,
const GallicWeight< Label, W, GALLIC > &  w2 
) [inline]

(General) gallic plus.

Definition at line 756 of file string-weight.h.

template<class W , class K >
SparsePowerWeight<W, K> fst::Plus ( const SparsePowerWeight< W, K > &  w1,
const SparsePowerWeight< W, K > &  w2 
) [inline]

Semimodule plus operation.

Definition at line 132 of file sparse-power-weight.h.

template<class Weight >
Weight fst::Power ( Weight  w,
size_t  n 
)
template<class T >
TropicalWeightTpl<T> fst::Power ( const TropicalWeightTpl< T > &  weight,
scalar 
) [inline]

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

template<class T >
LogWeightTpl<T> fst::Power ( const LogWeightTpl< T > &  weight,
scalar 
) [inline]

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

void fst::PrintFstInfoImpl ( const FstInfo &  fstinfo,
bool  pipe = false 
)
template<class Arc >
void fst::PrintPdtInfo ( const PdtInfo< Arc > &  info  ) 
template<class Arc >
void fst::Project ( MutableFst< Arc > *  fst,
ProjectType  project_type 
) [inline]
uint64 fst::ProjectProperties ( uint64  inprops,
bool  project_input 
)
template<class Arc , class ArcFilter , typename std::enable_if< (Arc::Weight::Properties()&kPath)==kPath >::type * = nullptr>
void fst::Prune ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
const PruneOptions< Arc, ArcFilter > &  opts 
)

Pruning algorithm: this version writes the pruned input FST to an output MutableFst and it takes an options class as an argument. The output FST contains states and arcs that belong to a successful path in the input FST whose weight is more than the weight of the shortest path Times() the provided weight threshold. When the state threshold is not kNoStateId, the output FST is further restricted to have no more than the number of states in opts.state_threshold. Weights have the path property. The weight of any cycle needs to be bounded; i.e.,

Plus(weight, Weight::One()) == Weight::One()

Definition at line 306 of file prune.h.

template<class Arc , class ArcFilter , typename std::enable_if< (Arc::Weight::Properties()&kPath)==kPath >::type * = nullptr>
void fst::Prune ( MutableFst< Arc > *  fst,
const PruneOptions< Arc, ArcFilter > &  opts 
)

Pruning algorithm: this version modifies its input and it takes an options class as an argument. After pruning the FST contains states and arcs that belong to a successful path in the FST whose weight is no more than the weight of the shortest path Times() the provided weight threshold. When the state threshold is not kNoStateId, the output FST is further restricted to have no more than the number of states in opts.state_threshold. Weights must have the path property. The weight of any cycle needs to be bounded; i.e.,

Plus(weight, Weight::One()) == Weight::One()

Definition at line 178 of file prune.h.

template<class Arc >
void fst::Prune ( MutableFst< Arc > *  fst,
typename Arc::Weight  weight_threshold,
typename Arc::StateId  state_threshold = kNoStateId,
double  delta = kDelta 
)

Pruning algorithm: this version modifies its input and takes the pruning threshold as an argument. It deletes states and arcs in the FST that do not belong to a successful path whose weight is more than the weight of the shortest path Times() the provided weight threshold. When the state threshold is not kNoStateId, the output FST is further restricted to have no more than the number of states in opts.state_threshold. Weights must have the path property. The weight of any cycle needs to be bounded; i.e.,

Plus(weight, Weight::One()) == Weight::One()

Definition at line 195 of file prune.h.

template<class Arc >
void fst::Prune ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
typename Arc::Weight  weight_threshold,
typename Arc::StateId  state_threshold = kNoStateId,
float  delta = kDelta 
)

Pruning algorithm: this version writes the pruned input FST to an output MutableFst and simply takes the pruning threshold as an argument. The output FST contains states and arcs that belong to a successful path in the input FST whose weight is no more than the weight of the shortest path Times() the provided weight threshold. When the state threshold is not kNoStateId, the output FST is further restricted to have no more than the number of states in opts.state_threshold. Weights must have the path property. The weight of any cycle needs to be bounded; i.e.,

Plus(weight, Weight::One()) = Weight::One();

Definition at line 325 of file prune.h.

template<class Arc >
SymbolTable* fst::PruneSymbolTable ( const Fst< Arc > &  fst,
const SymbolTable &  syms,
bool  input 
)
template<class Arc >
void fst::Push ( MutableFst< Arc > *  fst,
ReweightType  type,
float  delta = kDelta,
bool  remove_total_weight = false 
)
template<class Arc , ReweightType rtype>
void fst::Push ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
uint32  ptype,
float  delta = kDelta 
)

Pushes the weights and/or labels of the input FST into the output mutable FST by pushing weights and/or labels (as determined by the ptype argument) towards the initial state or final states (as determined by the rtype template parameter). The weight type must be left distributive when pushing weights towards the initial state, and right distribution when pushing weights towards the final states.

Definition at line 105 of file push.h.

template<class Arc , class ArcSelector >
bool fst::RandEquivalent ( const Fst< Arc > &  fst1,
const Fst< Arc > &  fst2,
int32  num_paths,
float  delta,
const RandGenOptions< ArcSelector > &  opts,
bool *  error = nullptr 
)
template<class Arc >
bool fst::RandEquivalent ( const Fst< Arc > &  fst1,
const Fst< Arc > &  fst2,
int32  num_paths,
float  delta = kDelta,
time_t  seed = time(nullptr),
int32  max_length = std::numeric_limits<int32>::max(),
bool *  error = nullptr 
)

Tests if two FSTs are equivalent by randomly generating a nnum_paths paths (no longer than the path_length) using a user-specified seed, optionally indicating an error setting an optional error argument to true.

Definition at line 102 of file randequivalent.h.

template<class Arc , class WeightGenerator >
void fst::RandFst ( const int  num_random_states,
const int  num_random_arcs,
const int  num_random_labels,
const float  acyclic_prob,
WeightGenerator *  weight_generator,
MutableFst< Arc > *  fst 
)
template<class FromArc , class ToArc , class Selector >
void fst::RandGen ( const Fst< FromArc > &  ifst,
MutableFst< ToArc > *  ofst,
const RandGenOptions< Selector > &  opts 
)
template<class FromArc , class ToArc >
void fst::RandGen ( const Fst< FromArc > &  ifst,
MutableFst< ToArc > *  ofst 
)

Randomly generate a path through an FST with the uniform distribution over the transitions.

Definition at line 742 of file randgen.h.

uint64 fst::RandGenProperties ( uint64  inprops,
bool  weighted 
)
template<typename I >
bool fst::ReadIntPairs ( const string &  filename,
std::vector< std::pair< I, I >> *  pairs,
bool  allow_negative = false 
)
template<typename Label >
bool fst::ReadLabelPairs ( const string &  filename,
std::vector< std::pair< Label, Label >> *  pairs,
bool  allow_negative = false 
)
template<typename Label >
bool fst::ReadLabelTriples ( const string &  filename,
std::vector< std::pair< Label, Label >> *  pairs,
std::vector< Label > *  assignments,
bool  allow_negative = false 
)
template<class Header >
bool fst::ReadSTListHeader ( const string &  filename,
Header *  header 
)
template<class Header >
bool fst::ReadSTTableHeader ( const string &  filename,
Header *  header 
)
template<class... T>
std::istream & fst::ReadType ( std::istream &  strm,
std::unordered_set< T...> *  c 
)
template<class T , typename std::enable_if< std::is_class< T >::value, T >::type * = nullptr>
std::istream & fst::ReadType ( std::istream &  strm,
T *  t 
) [inline]

Utility for type I/O.

Numeric (boolean, integral, floating-point) case.

Reads types from an input stream. Generic case.

Definition at line 53 of file util.h.

template<class... T>
std::istream & fst::ReadType ( std::istream &  strm,
std::vector< T...> *  c 
)

Declares types that can be read from an input stream.

namespace internal

Definition at line 117 of file util.h.

template<class... T>
std::istream & fst::ReadType ( std::istream &  strm,
std::set< T...> *  c 
)

Definition at line 128 of file util.h.

template<class... T>
std::istream & fst::ReadType ( std::istream &  strm,
std::map< T...> *  c 
)

Definition at line 133 of file util.h.

template<typename S , typename T >
std::istream& fst::ReadType ( std::istream &  strm,
std::pair< S, T > *  p 
) [inline]

Pair case.

Definition at line 86 of file util.h.

template<class... T>
std::istream & fst::ReadType ( std::istream &  strm,
std::list< T...> *  c 
)

Definition at line 123 of file util.h.

template<class... T>
std::istream & fst::ReadType ( std::istream &  strm,
std::unordered_map< T...> *  c 
)

Definition at line 144 of file util.h.

std::istream& fst::ReadType ( std::istream &  strm,
string *  s 
) [inline]

String case.

Definition at line 58 of file util.h.

template<typename S , typename T >
std::istream& fst::ReadType ( std::istream &  strm,
std::pair< const S, T > *  p 
) [inline]

Definition at line 93 of file util.h.

fst::REGISTER_FST ( CompactStringFst  ,
LogArc   
)
fst::REGISTER_FST ( CompactStringFst  ,
StdArc   
)

Register CompactFst for common arcs with the default (uint32) size type.

fst::REGISTER_FST ( CompactUnweightedAcceptorFst  ,
LogArc   
)
fst::REGISTER_FST ( CompactUnweightedFst  ,
StdArc   
)
fst::REGISTER_FST ( VectorFst  ,
Log64Arc   
)
fst::REGISTER_FST ( ConstFst  ,
StdArc   
)
fst::REGISTER_FST ( CompactAcceptorFst  ,
StdArc   
)
fst::REGISTER_FST ( CompactWeightedStringFst  ,
StdArc   
)
fst::REGISTER_FST ( VectorFst  ,
StdArc   
)

Registers VectorFst, ConstFst and EditFst for common arcs types.

fst::REGISTER_FST ( ConstFst  ,
LogArc   
)
fst::REGISTER_FST ( EditFst  ,
StdArc   
)
fst::REGISTER_FST ( EditFst  ,
Log64Arc   
)
fst::REGISTER_FST ( CompactWeightedStringFst  ,
LogArc   
)
fst::REGISTER_FST ( CompactUnweightedFst  ,
LogArc   
)
fst::REGISTER_FST ( CompactAcceptorFst  ,
LogArc   
)
fst::REGISTER_FST ( EditFst  ,
LogArc   
)
fst::REGISTER_FST ( CompactUnweightedAcceptorFst  ,
StdArc   
)
fst::REGISTER_FST ( ConstFst  ,
Log64Arc   
)
fst::REGISTER_FST ( VectorFst  ,
LogArc   
)
template<class Arc >
void fst::Relabel ( MutableFst< Arc > *  fst,
const SymbolTable *  new_isymbols,
const SymbolTable *  new_osymbols 
)
template<class Arc >
void fst::Relabel ( MutableFst< Arc > *  fst,
const SymbolTable *  old_isymbols,
const SymbolTable *  new_isymbols,
const string &  unknown_isymbol,
bool  attach_new_isymbols,
const SymbolTable *  old_osymbols,
const SymbolTable *  new_osymbols,
const string &  unknown_osymbol,
bool  attach_new_osymbols 
)

Relabels either the input labels or output labels. The old to new labels are specified using pairs of old and new symbol tables. The tables must contain (at least) all labels on the appropriate side of the FST. If the 'unknown_i(o)symbol' is non-empty, it is used to label any missing symbol in new_i(o)symbols table.

Definition at line 81 of file relabel.h.

template<class Arc >
void fst::Relabel ( MutableFst< Arc > *  fst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  ipairs,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  opairs 
)

Relabels either the input labels or output labels. The old to new labels are specified using a vector of std::pair<Label, Label>. Any label associations not specified are assumed to be identity mapping. The destination labels must be valid labels (e.g., not kNoLabel).

Definition at line 29 of file relabel.h.

template<class Arc >
void fst::Relabel ( MutableFst< Arc > *  fst,
const SymbolTable *  old_isymbols,
const SymbolTable *  new_isymbols,
bool  attach_new_isymbols,
const SymbolTable *  old_osymbols,
const SymbolTable *  new_osymbols,
bool  attach_new_osymbols 
)

Same as previous but no special allowance for unknown symbols. Kept for backward compat.

Definition at line 166 of file relabel.h.

uint64 fst::RelabelProperties ( uint64  inprops  ) 
template<class Label >
SymbolTable* fst::RelabelSymbolTable ( const SymbolTable *  table,
const std::vector< std::pair< Label, Label >> &  pairs 
)
template<class Arc >
void fst::RemoveWeight ( MutableFst< Arc > *  fst,
const typename Arc::Weight &  weight,
bool  at_final 
)
template<class Arc >
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &  ifst_array,
MutableFst< Arc > *  ofst,
std::vector< std::pair< typename Arc::Label, typename Arc::Label >> *  parens,
typename Arc::Label  root 
)
template<class Arc >
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &  ifst_array,
MutableFst< Arc > *  ofst,
ReplaceFstOptions< Arc >  opts = ReplaceFstOptions<Arc>() 
)

Recursively replaces arcs in the root FSTs with other FSTs. This version writes the result of replacement to an output MutableFst.

Replace supports replacement of arcs in one Fst with another FST. This replacement is recursive. Replace takes an array of FST(s). One FST represents the root (or topology) machine. The root FST refers to other FSTs by recursively replacing arcs labeled as non-terminals with the matching non-terminal FST. Currently Replace uses the output symbols of the arcs to determine whether the arc is a non-terminal arc or not. A non-terminal can be any label that is not a non-zero terminal label in the output alphabet.

Note that input argument is a vector of pairs. These correspond to the tuple of non-terminal Label and corresponding FST.

Definition at line 1436 of file replace.h.

template<class Arc >
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &  ifst_array,
MutableFst< Arc > *  ofst,
std::vector< std::pair< typename Arc::Label, typename Arc::Label >> *  parens,
const PdtReplaceOptions< Arc > &  opts 
)

Builds a pushdown transducer (PDT) from an RTN specification. The result is a PDT written to a mutable FST where some transitions are labeled with open or close parentheses. To be interpreted as a PDT, the parens must balance on a path (see PdtExpand()). The open/close parenthesis label pairs are returned in the parens argument.

Definition at line 785 of file replace.h.

template<class Arc >
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &  ifst_array,
MutableFst< Arc > *  ofst,
const ReplaceUtilOptions &  opts 
)

Defined in replace.h.

Definition at line 1446 of file replace.h.

template<class Arc >
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &  ifst_array,
MutableFst< Arc > *  ofst,
typename Arc::Label  root,
bool  epsilon_on_replace 
)

For backwards compatibility.

Definition at line 1454 of file replace.h.

template<class Arc >
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> &  ifst_array,
MutableFst< Arc > *  ofst,
typename Arc::Label  root 
)

Definition at line 1462 of file replace.h.

template<class Arc >
uint64 fst::ReplaceFstProperties ( typename Arc::Label  root_label,
const FstList< Arc > &  fst_list,
ReplaceLabelType  call_label_type,
ReplaceLabelType  return_label_type,
typename Arc::Label  call_output_label,
bool *  sorted_and_non_empty 
)
uint64 fst::ReplaceProperties ( const std::vector< uint64 > &  inprops,
ssize_t  root,
bool  epsilon_on_call,
bool  epsilon_on_return,
bool  out_epsilon_on_call,
bool  out_epsilon_on_return,
bool  replace_transducer,
bool  no_empty_fst,
bool  all_ilabel_sorted,
bool  all_olabel_sorted,
bool  all_negative_or_dense 
)
template<class Label >
bool fst::ReplaceTransducer ( ReplaceLabelType  call_label_type,
ReplaceLabelType  return_label_type,
Label  call_output_label 
)
template<class Arc , class RevArc >
void fst::Reverse ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
MutableFst< RevArc > *  ofst 
)
template<class Arc , class RevArc >
void fst::Reverse ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
std::vector< typename Arc::Label > *  assignments,
MutableFst< RevArc > *  ofst 
)

Reverses a multi-stack pushdown transducer (MPDT) encoded as an FST.

Definition at line 20 of file reverse.h.

template<class FromArc , class ToArc >
void fst::Reverse ( const Fst< FromArc > &  ifst,
MutableFst< ToArc > *  ofst,
bool  require_superinitial = true 
)

Reverses an FST. The reversed result is written to an output mutable FST. If A transduces string x to y with weight a, then the reverse of A transduces the reverse of x to the reverse of y with weight a.Reverse().

Typically, a = a.Reverse() and an arc is its own reverse (e.g., for TropicalWeight or LogWeight). In general, e.g., when the weights only form a left or right semiring, the output arc type must match the input arc type except having the reversed Weight type.

When require_superinitial is false, a superinitial state is not created in the reversed FST iff the input FST has exactly one final state (which becomes the initial state of the reversed FST) with a final weight of semiring One, or if it does not belong to any cycle. When require_superinitial is true, a superinitial state is always created.

Definition at line 32 of file reverse.h.

constexpr GallicType fst::ReverseGallicType ( GallicType  g  ) 
uint64 fst::ReverseProperties ( uint64  inprops,
bool  has_superinitial 
)
constexpr StringType fst::ReverseStringType ( StringType  s  ) 
template<class Arc >
void fst::Reweight ( MutableFst< Arc > *  fst,
const std::vector< typename Arc::Weight > &  potential,
ReweightType  type 
)
uint64 fst::ReweightProperties ( uint64  inprops  ) 
template<class Arc >
void fst::RmEpsilon ( MutableFst< Arc > *  fst,
bool  connect = true,
typename Arc::Weight  weight_threshold = Arc::Weight::Zero(),
typename Arc::StateId  state_threshold = kNoStateId,
float  delta = kDelta 
)
template<class Arc , class Queue >
void fst::RmEpsilon ( MutableFst< Arc > *  fst,
std::vector< typename Arc::Weight > *  distance,
const RmEpsilonOptions< Arc, Queue > &  opts 
)

namespace internal

Removes epsilon-transitions (when both the input and output label are an epsilon) from a transducer. The result will be an equivalent FST that has no such epsilon transitions. This version modifies its input. It allows fine control via the options argument; see below for a simpler interface.

The distance vector will be used to hold the shortest distances during the epsilon-closure computation. The state queue discipline and convergence delta are taken in the options argument.

Definition at line 192 of file rmepsilon.h.

uint64 fst::RmEpsilonProperties ( uint64  inprops,
bool  delayed = false 
)
template<class Arc >
void fst::RmFinalEpsilon ( MutableFst< Arc > *  fst  ) 
template<typename Weight >
uint64 fst::SetFinalProperties ( uint64  inprops,
Weight  old_weight,
Weight  new_weight 
)
uint64 fst::SetStartProperties ( uint64  inprops  )  [inline]

PROPERTY FUNCTIONS and STRING NAMES (defined in properties.cc).

Definitions of inlined functions.

Below are functions for getting property bit vectors when executing mutation operations.

Definition at line 366 of file properties.h.

template<class Arc , class Queue , class ArcFilter >
void fst::ShortestDistance ( const Fst< Arc > &  fst,
std::vector< typename Arc::Weight > *  distance,
const ShortestDistanceOptions< Arc, Queue, ArcFilter > &  opts 
)
template<class Arc >
void fst::ShortestDistance ( const Fst< Arc > &  fst,
std::vector< typename Arc::Weight > *  distance,
bool  reverse = false,
float  delta = kDelta 
)

Shortest-distance algorithm: simplified interface. See above for a version that permits finer control.

If reverse is false, this computes the shortest distance from the initial state to each state S and stores the value in the distance vector. If reverse is true, this computes the shortest distance from each state to the final states. An unvisited state S has distance Zero(), which will be stored in the distance vector if S is less than the maximum visited state. The state queue discipline is automatically-selected. The distance vector will contain a unique element for which Member() is false if an error was encountered.

The weights must must be right (left) distributive if reverse is false (true) and k-closed (i.e., 1 + x + x^2 + ... + x^(k +1) = 1 + x + x^2 + ... + x^k).

Arc weights must satisfy the property that the sum of the weights of one or more paths from some state S to T is never Zero(). In particular, arc weights are never Zero().

Complexity:

Depends on properties of the semiring and the queue discipline.

For more information, see:

Mohri, M. 2002. Semiring framework and algorithms for shortest-distance problems, Journal of Automata, Languages and Combinatorics 7(3): 321-350, 2002.

Definition at line 270 of file shortest-distance.h.

template<class Arc >
Arc::Weight fst::ShortestDistance ( const Fst< Arc > &  fst,
float  delta = kDelta 
)

Return the sum of the weight of all successful paths in an FST, i.e., the shortest-distance from the initial state to the final states. Returns a weight such that Member() is false if an error was encountered.

Definition at line 308 of file shortest-distance.h.

template<class Arc , class Queue , class ArcFilter , typename std::enable_if< (Arc::Weight::Properties()&(kPath|kSemiring))==(kPath|kSemiring)>::type * = nullptr>
void fst::ShortestPath ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
std::vector< typename Arc::Weight > *  distance,
const ShortestPathOptions< Arc, Queue, ArcFilter > &  opts 
)
template<class Arc >
void fst::ShortestPath ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
MutableFst< Arc > *  ofst 
)

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

template<class Arc , class Queue >
void fst::ShortestPath ( const Fst< Arc > &  ifst,
const std::vector< std::pair< typename Arc::Label, typename Arc::Label >> &  parens,
MutableFst< Arc > *  ofst,
const PdtShortestPathOptions< Arc, Queue > &  opts 
)

Functional variants.

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

template<class Arc >
void fst::ShortestPath ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst,
int32  nshortest = 1,
bool  unique = false,
bool  first_path = false,
typename Arc::Weight  weight_threshold = Arc::Weight::Zero(),
typename Arc::StateId  state_threshold = kNoStateId 
)

Shortest-path algorithm: simplified interface. See above for a version that allows finer control. The output mutable FST contains the n-shortest paths in the input FST. The queue discipline is automatically selected. When unique is true, only paths with distinct input label sequences are returned.

The n-shortest paths are the n-lowest weight paths w.r.t. the natural semiring order. The single path that can be read from the ith of at most n transitions leaving the initial state of the ouput FST is the ith best path. The weights need to be right distributive and have the path (kPath) property.

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

uint64 fst::ShortestPathProperties ( uint64  props,
bool  tree 
)
template<class W1 , class W2 >
bool fst::SignedLogConvertCheck ( W1  weight  ) 
template<class W , class K , class M >
void fst::SparseTupleWeightMap ( SparseTupleWeight< W, K > *  result,
const SparseTupleWeight< W, K > &  w1,
const SparseTupleWeight< W, K > &  w2,
const M &  operator_mapper 
) [inline]
void fst::SplitToVector ( char *  line,
const char *  delim,
std::vector< char * > *  vec,
bool  omit_empty_strings 
)
template<class A , class C >
void fst::StateMap ( MutableFst< A > *  fst,
C *  mapper 
)

StateMapper Interface. The class determines how states are mapped; useful for implementing operations that do not change the number of states.

class StateMapper { public: using FromArc = A; using ToArc = B;

Typical constructor. StateMapper(const Fst<A> &fst);

Required copy constructor that allows updating FST argument; pass only if relevant and changed. StateMapper(const StateMapper &mapper, const Fst *fst = 0);

Specifies initial state of result. B::StateId Start() const; Specifies state's final weight in result. B::Weight Final(B::StateId state) const;

These methods iterate through a state's arcs in result.

Specifies state to iterate over. void SetState(B::StateId state);

End of arcs? bool Done() const;

Current arc. const B &Value() const;

Advances to next arc (when !Done) void Next();

Specifies input symbol table action the mapper requires (see above). MapSymbolsAction InputSymbolsAction() const;

Specifies output symbol table action the mapper requires (see above). MapSymbolsAction OutputSymbolsAction() const;

This specifies the known properties of an FST mapped by this mapper. It takes as argument the input FST's known properties. uint64 Properties(uint64 props) const; };

We include a various state map versions below. One dimension of variation is whether the mapping mutates its input, writes to a new result FST, or is an on-the-fly Fst. Another dimension is how we pass the mapper. We allow passing the mapper by pointer for cases that we need to change the state of the user's mapper. We also include map versions that pass the mapper by value or const reference when this suffices. Maps an arc type A using a mapper function object C, passed by pointer. This version modifies the input FST.

Definition at line 79 of file state-map.h.

template<class A , class B , class C >
void fst::StateMap ( const Fst< A > &  ifst,
MutableFst< B > *  ofst,
C *  mapper 
)

Maps an arc type A to an arc type B using mapper functor C, passed by pointer. This version writes to an output FST.

Definition at line 111 of file state-map.h.

template<class A , class B , class C >
void fst::StateMap ( const Fst< A > &  ifst,
MutableFst< B > *  ofst,
mapper 
)

Maps an arc type A to an arc type B using mapper functor object C, passed by value. This version writes to an output FST.

Definition at line 149 of file state-map.h.

template<class A , class C >
void fst::StateMap ( MutableFst< A > *  fst,
mapper 
)

Maps an arc type A using a mapper function object C, passed by value. This version modifies the input FST.

Definition at line 104 of file state-map.h.

template<class Arc >
void fst::StateSort ( MutableFst< Arc > *  fst,
const std::vector< typename Arc::StateId > &  order 
)
template<class Arc >
Fst<Arc>* fst::StringToFst ( const string &  s  ) 
SymbolTable * fst::StringToSymbolTable ( const string &  str  ) 
int64 fst::StrToInt64 ( const string &  s,
const string &  src,
size_t  nline,
bool  allow_negative,
bool *  error = nullptr 
)
template<typename Weight >
Weight fst::StrToWeight ( const string &  s,
const string &  src,
size_t  nline 
)
void fst::SymbolTableToString ( const SymbolTable *  table,
string *  result 
)
template<class Arc >
void fst::Synchronize ( const Fst< Arc > &  ifst,
MutableFst< Arc > *  ofst 
)

Synchronizes a transducer. This version writes the synchronized result to a MutableFst. The result will be an equivalent FST that has the property that during the traversal of a path, the delay is either zero or strictly increasing, where the delay is the difference between the number of non-epsilon output labels and input labels along the path.

For the algorithm to terminate, the input transducer must have bounded delay, i.e., the delay of every cycle must be zero.

Complexity:

  • A has bounded delay: exponential.
  • A does not have bounded delay: does not terminate.

For more information, see:

Mohri, M. 2003. Edit-distance of weighted automata: General definitions and algorithms. International Journal of Computer Science 14(6): 957-982.

Definition at line 406 of file synchronize.h.

uint64 fst::SynchronizeProperties ( uint64  inprops  ) 
template<class Arc >
uint64 fst::TestProperties ( const Fst< Arc > &  fst,
uint64  mask,
uint64 *  known 
)
template<class X1 , class X2 >
ExpectationWeight<X1, X2> fst::Times ( const ExpectationWeight< X1, X2 > &  w1,
const ExpectationWeight< X1, X2 > &  w2 
) [inline]
template<class W , size_t n>
PowerWeight<W, n> fst::Times ( const PowerWeight< W, n > &  w1,
const PowerWeight< W, n > &  w2 
) [inline]

Semiring times operation.

Definition at line 93 of file power-weight.h.

template<class T >
LogWeightTpl<T> fst::Times ( const LogWeightTpl< T > &  w1,
const LogWeightTpl< T > &  w2 
) [inline]

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

template<class W , class O >
UnionWeight<W, O> fst::Times ( const UnionWeight< W, O > &  w1,
const UnionWeight< W, O > &  w2 
) [inline]

Definition at line 426 of file union-weight.h.

TropicalWeightTpl<double> fst::Times ( const TropicalWeightTpl< double > &  w1,
const TropicalWeightTpl< double > &  w2 
) [inline]

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

MinMaxWeightTpl<double> fst::Times ( const MinMaxWeightTpl< double > &  w1,
const MinMaxWeightTpl< double > &  w2 
) [inline]

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

template<class W , class K >
SparsePowerWeight<W, K> fst::Times ( const SparsePowerWeight< W, K > &  w1,
const SparsePowerWeight< W, K > &  w2 
) [inline]

Semimodule times operation.

Definition at line 142 of file sparse-power-weight.h.

template<class T >
MinMaxWeightTpl<T> fst::Times ( const MinMaxWeightTpl< T > &  w1,
const MinMaxWeightTpl< T > &  w2 
) [inline]

Max.

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

template<typename Label , StringType S>
StringWeight<Label, S> fst::Times ( const StringWeight< Label, S > &  w1,
const StringWeight< Label, S > &  w2 
) [inline]

Definition at line 394 of file string-weight.h.

template<typename Label >
SetWeight<Label, SET_BOOLEAN> fst::Times ( const SetWeight< Label, SET_BOOLEAN > &  w1,
const SetWeight< Label, SET_BOOLEAN > &  w2 
) [inline]

Times = And.

Definition at line 498 of file set-weight.h.

template<typename Label >
SetWeight<Label, SET_UNION_INTERSECT> fst::Times ( const SetWeight< Label, SET_UNION_INTERSECT > &  w1,
const SetWeight< Label, SET_UNION_INTERSECT > &  w2 
) [inline]

Times = Intersect.

Definition at line 490 of file set-weight.h.

template<class T >
TropicalWeightTpl<T> fst::Times ( const TropicalWeightTpl< T > &  w1,
const TropicalWeightTpl< T > &  w2 
) [inline]

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

template<class W , class K >
SparsePowerWeight<W, K> fst::Times ( const W &  k,
const SparsePowerWeight< W, K > &  w2 
) [inline]

Definition at line 184 of file sparse-power-weight.h.

template<class W , class K >
SparsePowerWeight<W, K> fst::Times ( const SparsePowerWeight< W, K > &  w1,
const W &  k 
) [inline]

Definition at line 192 of file sparse-power-weight.h.

template<class W1 , class W2 >
LexicographicWeight<W1, W2> fst::Times ( const LexicographicWeight< W1, W2 > &  w,
const LexicographicWeight< W1, W2 > &  v 
) [inline]

Definition at line 122 of file lexicographic-weight.h.

MinMaxWeightTpl<float> fst::Times ( const MinMaxWeightTpl< float > &  w1,
const MinMaxWeightTpl< float > &  w2 
) [inline]

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

template<class T >
SignedLogWeightTpl<T> fst::Times ( const SignedLogWeightTpl< T > &  w1,
const SignedLogWeightTpl< T > &  w2 
) [inline]

Definition at line 139 of file signed-log-weight.h.

LogWeightTpl<double> fst::Times ( const LogWeightTpl< double > &  w1,
const LogWeightTpl< double > &  w2 
) [inline]

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

template<typename Label , SetType S>
SetWeight<Label, S> fst::Times ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]

Default: Times = Union.

Definition at line 482 of file set-weight.h.

template<class W , size_t n>
PowerWeight<W, n> fst::Times ( const W &  scalar,
const PowerWeight< W, n > &  weight 
) [inline]

Semimodule left scalar product.

Definition at line 116 of file power-weight.h.

template<class Label , class W , GallicType G>
GallicWeight<Label, W, G> fst::Times ( const GallicWeight< Label, W, G > &  w,
const GallicWeight< Label, W, G > &  v 
) [inline]

Definition at line 628 of file string-weight.h.

template<class Label , class W >
GallicWeight<Label, W, GALLIC> fst::Times ( const GallicWeight< Label, W, GALLIC > &  w1,
const GallicWeight< Label, W, GALLIC > &  w2 
) [inline]

(General) gallic times.

Definition at line 766 of file string-weight.h.

template<class W1 , class W2 >
ProductWeight<W1, W2> fst::Times ( const ProductWeight< W1, W2 > &  w1,
const ProductWeight< W1, W2 > &  w2 
) [inline]

Definition at line 76 of file product-weight.h.

template<class W , size_t n>
PowerWeight<W, n> fst::Times ( const PowerWeight< W, n > &  weight,
const W &  scalar 
) [inline]

Semimodule right scalar product.

Definition at line 127 of file power-weight.h.

LogWeightTpl<float> fst::Times ( const LogWeightTpl< float > &  w1,
const LogWeightTpl< float > &  w2 
) [inline]

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

TropicalWeightTpl<float> fst::Times ( const TropicalWeightTpl< float > &  w1,
const TropicalWeightTpl< float > &  w2 
) [inline]

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

template<class Arc >
bool fst::TopSort ( MutableFst< Arc > *  fst  ) 
string fst::TranslateLabel ( int64  label,
const SymbolTable *  syms 
) [inline]
template<typename Label , SetType S>
SetWeight<Label, S> fst::Union ( const SetWeight< Label, S > &  w1,
const SetWeight< Label, S > &  w2 
) [inline]
template<class Arc >
void fst::Union ( RationalFst< Arc > *  fst1,
const Fst< Arc > &  fst2 
)

Computes the union of two FSTs, modifying the RationalFst argument.

Definition at line 86 of file union.h.

template<class Arc >
void fst::Union ( MutableFst< Arc > *  fst1,
const Fst< Arc >