Module rustfst::algorithms

source ·
Expand description

Provides algorithms that are generic to all Fst.

Modules§

  • Functions to compute Kleene closure (star or plus) of an FST.
  • Functions to compose FSTs.
  • Functions to concatenate FSTs.
  • Functions to determinize FSTs.
  • Functions to encode FSTs as FSAs and vice versa.
  • Functions to factor various weight types.
  • Module providing the necessary functions to implement a new Delayed Fst.
  • Module providing different structures implementing the Queue trait.
  • Functions to randomly generate paths through an Fst. A static and a delayed version are available.
  • Functions for lazy replacing transitions in an FST.
  • Functions to remove epsilon transitions from an Fst. A static and a delayed version are available.
  • Functions to compare / sort the Trs of an FST.
  • Function objects to restrict which trs are traversed in an FST.
  • Module that provides structures implementing the TrMapper trait.
  • Functions to compute the union of FSTs.
  • Module providing structures implementing the WeightConverter trait.

Structs§

Enums§

Traits§

  • Unified interface to use different implementation of Queues.
  • The TrMapper interfaces defines how trs and final weights are mapped. This is useful for implementing operations that do not change the number of trs.
  • The WeightConverter interfaces defines how a weight should be turned into another one. Useful for changing the semiring of an FST.

Functions§

  • In place minimization for weighted final state acceptor. If allow_acyclic_minimization is true and the input is acyclic, then a specific minimization is applied.
  • Add, if needed, a super final state to the given FST. The super final state is returned if it is possible.
  • Compute the shortest distance from each state to every other states. The shortest distance from p to q is the ⊕-sum of the weights of all the paths between p and q.
  • Return an acyclic FST where each SCC in the input FST has been condensed to a single state with transitions between SCCs retained and within SCCs dropped.
  • Trim an Fst, removing states and trs that are not on successful paths.
  • Generic method to convert an Fst into any other types implementing the MutableFst trait.
  • Generic method to convert an Fst into any other types implementing the MutableFst trait.
  • Invert the transduction corresponding to an FST by exchanging the FST’s input and output labels.
  • Determine if two transducers with a certain required determinism have the same states, irrespective of numbering, and the same transitions with the same labels and weights, irrespective of ordering.
  • Determine, with configurable comparison delta, if two transducers with a certain required determinism have the same states, irrespective of numbering, and the same transitions with the same labels and weights, irrespective of ordering.
  • In place minimization of deterministic weighted automata and transducers, and also non-deterministic ones if they use an idempotent semiring. For transducers, the algorithm produces a compact factorization of the minimal transducer.
  • In place minimization of deterministic weighted automata and transducers, and also non-deterministic ones if they use an idempotent semiring. For transducers, the algorithm produces a compact factorization of the minimal transducer.
  • General optimization (determinization and minimization) of a WFST
  • This operation projects an FST onto its domain or range by either copying each transition input label to its output label or vice versa.
  • Push the weights and/or labels of the input FST into the output mutable FST by pushing weights and/or labels towards the initial state or final states.
  • Push the weights in an FST.
  • Push the weights in an FST, optionally removing the total weight.
  • Push the weights and/or labels of the input FST into the output mutable FST by pushing weights and/or labels towards the initial state or final states.
  • Replace input and/or output labels using pairs of labels.
  • Reverse an FST.
  • Reweight an FST according to a vector of potentials in a given direction.
  • Removes final states that have epsilon-only input trs.
  • Compute the shortest distance from the initial state to every state. The shortest distance from p to q is the ⊕-sum of the weights of all the paths between p and q.
  • Compute the shortest distance from the initial state to every state, with configurable delta for comparison.
  • Create an FST containing the single shortest path in the input FST. The shortest path is the lowest weight paths w.r.t. the natural semiring order.
  • Create an FST containing the n-shortest paths in the input FST. The n-shortest paths are the n-lowest weight paths w.r.t. the natural semiring order.
  • Sort the input states of an FST.
  • Topologically sort an FST. When sorted, all transitions are from lower to higher state IDs.
  • Maps every transition in the FST using an TrMapper object.
  • Sorts trs leaving each state of the FST using a compare function
  • Plus-Sum weights of trs leaving the same state, going to the same state and with the same input and output labels.
  • Keep a single instance of trs leaving the same state, going to the same state and with the same input labels, output labels and weight.
  • Convert an FST in a given Semiring to another Semiring using a WeightConverter to specify how the conversion should be performed.