Union
Description
This operation computes the union (
sum) of two FSTs. If
A
transduces string
x
to
y
with weight
a
and
B
transduces string
w
to
v
with weight
b
, then their union transduces
x
to
y
with weight
a
and
w
to
v
with weight
b
.
Usage
template <class Arc>
void Union(MutableFst<Arc> *fst1, const Fst<Arc> &fst2);
|
[bad link?] |
template <class Arc> UnionFst<Arc>::
UnionFst(const Fst<Arc> &fst1, const Fst<Arc> &fst2);
|
|
fstunion a.fst b.fst out.fst |
|
Examples
A
:
B
:
A ∪ B
:
Union(&A, B);
UnionFst<Arc>(A, B);
fstunion a.fst b.fst out.fst
Complexity
Union
:
O(V2 + E2), where
Vi = # of states and
Ei = # of arcs of the
ith FST.
UnionFst:
- Constructor: O(1)
- Traversal: O(v1 + e1 + v2 + e2),
where vi = # of states visited and ei = # of arcs visited of the ith FST and constant time to visit an input state or arc is assumed.
--
MichaelRiley - 1 Jul 2007