Replace
Description
Usage
template <class Arc>
Replace(const vector<pair<typename Arc::Label, const Fst<Arc>* > > >&label_fst_pairs,
MutableFst<Arc> *ofst,
typename Arc::Label root,
bool epsilon_on_replace);
|
[bad link?] |
template <class Arc> ReplaceFst<Arc>::
ReplaceFst(const vector<pair<typename Arc::Label, const Fst<Arc>* > > > &label_fst_pairs,
typename Arc::Label root,
bool epsilon_on_replace);
|
|
fstreplace [--epsilon_on_replace] root.fst rootlabel [subfst1.fst label1 ....] [out.fst]
|
Examples
Symbol table
eps |
0 |
$Root |
1 |
$Name |
2 |
$FirstName |
3 |
$LastName |
4 |
dial |
5 |
please |
6 |
johan |
7 |
schalkwyk |
8 |
google |
9 |
michael |
10 |
riley |
11 |
A1
root FST:
A2
FST for nonterminal
$Name
:
A3
FST for nonterminal
$FirstName
:
A4
Fst for nonterminal
$LastName
:
B
vector<pair<Label, const Fst<Arc>*> > > label_fst_pairs;
label_fst_pairs.push_back(make_pair(1, A1.Copy()));
label_fst_pairs.push_back(make_pair(2, A2.Copy()));
label_fst_pairs.push_back(make_pair(3, A3.Copy()));
label_fst_pairs.push_back(make_pair(4, A4.Copy()));
Replace(label_fst_pairs, &B, 1, true);
ReplaceFst<Arc> B(label_fst_pairs, 1, true);
fstreplace --epsilon_on_replace a1.fst 1 a2.fst 2 a3.fst 3 a4.fst 4 b.fst
--
CyrilAllauzen - 02 Mar 2009