The OpenFst Libary has various conventions and assumptions about its objects and coding style.
StateIds
of an FST are dense integers, numbered from 0 to NumStates()
- 1.
StateIterator
returns StateIds
in numerical order.
StateId
s from an FST unless the FST has already returned a StateId
t ≥ s (e.g. from Start()
, NumStates()
, StateIterator
, or ArcIterator->Value().nextstate
).
kNoStateId
; a non-empty machine (has states) has a valid start state.
Label
is a non-negative integer except kNoLabel
(or library internals). The label 0
is reserved for epsilon.
Weight
satisfies the properties described here.
StateIterator
is invalidated if the number of states is modified.
ArcIterator
for a state is invalidated by any mutation of the arcs at that state.
MutableArcIterator
is invalidated by any mutation of the arcs at that state other than by the iterator itself.
Matcher
is invalidated by any mutation of an FST.
F(const &F)
.
Copy()
method of an FST have constant time and space complexity (shallow copy) unless otherwise noted.'
int
or float
when referring to FST components. Use: StateId
for state Ids and number of states.
Label
for labels.
size_t
for other array lengths.
Weight
for weights.
C
is templated on an Arc, then C::Arc
will give that type.