Difference: RelabelDoc (1 vs. 5)

Revision 52018-04-27 - MichaelRiley

Line: 1 to 1
 
META TOPICPARENT name="FstQuickTour"

Relabel

Line: 16 to 16
  MutableFst *fst, const vector<pair >& ipairs, const vector<pair >& opairs);
Changed:
<
<
| %DOX{namespacefst.html#Relabel[doc]}% |
>
>
| |
 |
template<class Arc>
void Relabel(

Revision 42009-03-26 - CyrilAllauzen

Line: 1 to 1
 
META TOPICPARENT name="FstQuickTour"

Relabel

Description

Changed:
<
<
Work in progress, under construction TBA
>
>
This operation relabels the input and/or output labels of an FST. The input and/or output relabeling are specified by providing the corresponding sets of pairs (old_label, new_label) of label IDs .
 
Changed:
<
<
This operation relabels the input and/or output labels of an FST. The relabeling can be specified by a set of pair of integer labels.

When the FST has input and/or output symbol tables, the relabeling can be specified by giving new input and/or output symbol tables. The operation then modifies the interger labels of each arc in such a way that its symbolic labels are preserved.

>
>
When the FST has input and/or output symbol tables, the relabeling can be specified by giving new input and/or output symbol tables. The operation then modifies the label IDs of each arc in such a way that the symbols are preserved.
 

Usage

Line: 44 to 42
 
fstrelabel [--relabel_isymbols=$isyms] [--relabel_osymbols=$osyms] in.fst out.fst 
Deleted:
<
<

Examples

 
Changed:
<
<
Work in progress, under construction TBA
>
>

Examples

 

A:

Changed:
<
<
symbol table S1
>
>
S1
 
eps 0
a 1
b 2
Line: 62 to 59
 
A
relabel.png relabel_s1.png
Changed:
<
<

B:

>
>

Relabel(&A):

 
S2
Changed:
<
<
eps 0
g 1
f 2
d 3
c 4
b 5
a 6
>
>
eps 0
a 6
b 5
c 4
d 3
f 2
g 1
 
B
relabel.png relabel_s2.png
Added:
>
>
Relabel(&A, S2, S2); RelabelFst B(A, S2, S2);
  fstrelabel --relabel_isymbols=s2 --relabel_osymbols=s2 a.fst b.fst
Added:
>
>
P
0 0
1 6
2 5
3 4
4 3
5 2
6 1

Relabel(&A, P, P);
RelabelFst<Arc> B(A, P, P);

fstrelabel --relabel_ipairs=p --relabel_opairs=p a.fst b.fst
 

Complexity

Relabel

Revision 32009-03-25 - CyrilAllauzen

Line: 1 to 1
 
META TOPICPARENT name="FstQuickTour"

Relabel

Line: 6 to 6
  Work in progress, under construction TBA
Added:
>
>
This operation relabels the input and/or output labels of an FST. The relabeling can be specified by a set of pair of integer labels.

When the FST has input and/or output symbol tables, the relabeling can be specified by giving new input and/or output symbol tables. The operation then modifies the interger labels of each arc in such a way that its symbolic labels are preserved.

 

Usage

|

Line: 44 to 48
  Work in progress, under construction TBA
Added:
>
>

A:

symbol table S1
eps 0
a 1
b 2
c 3
d 4
f 5
g 6

A
relabel.png relabel_s1.png

B:

S2
eps 0
g 1
f 2
d 3
c 4
b 5
a 6

B
relabel.png relabel_s2.png


fstrelabel  --relabel_isymbols=s2 --relabel_osymbols=s2 a.fst b.fst
 

Complexity

Relabel

Line: 57 to 94
 where v = # of states visited, e = # of arcs visited of the input FST, Si = # of input symbols and So = # of output symbols. Constant time and space to visit an input state or arc is assumed and exclusive of caching.

-- CyrilAllauzen - 03 Mar 2009

Added:
>
>
META FILEATTACHMENT attachment="relabel.png" attr="" comment="Relabel example: fst =A=" date="1238020724" name="relabel.png" path="relabel.png" size="11111" stream="relabel.png" tmpFilename="/var/tmp/CGItemp10825" user="CyrilAllauzen" version="1"
META FILEATTACHMENT attachment="relabel_s1.png" attr="" comment="Relabel example: fst A with integer labels" date="1238023650" name="relabel_s1.png" path="relabel_s1.png" size="10899" stream="relabel_s1.png" tmpFilename="/var/tmp/CGItemp13982" user="CyrilAllauzen" version="3"
META FILEATTACHMENT attachment="relabel_s2.png" attr="" comment="Relabel example: fst B with integer labels" date="1238023667" name="relabel_s2.png" path="relabel_s2.png" size="10958" stream="relabel_s2.png" tmpFilename="/var/tmp/CGItemp14024" user="CyrilAllauzen" version="2"

Revision 22009-03-06 - CyrilAllauzen

Line: 1 to 1
 
META TOPICPARENT name="FstQuickTour"

Relabel

Line: 47 to 47
 

Complexity

Relabel

Changed:
<
<
  • Time: O(V + E)
  • Space: O(1)
where V = # of states and E = # of arcs of the input FST.
>
>
  • Time: O(V + E + Si + So)
  • Space: O(Si + So)
where V = # of states, E = # of arcs of the input FST, Si = # of input symbols and So = # of output symbols.
  RelabelFst
Changed:
<
<
  • Time: O(v + e)
  • Space: O(v + e)
where v = # of states visited and e = # of arcs visited of the input FST. Constant time and space to visit an input state or arc is assumed and exclusive of caching.
>
>
  • Time: O(v + e + Si + So)
  • Space: O(Si + So)
where v = # of states visited, e = # of arcs visited of the input FST, Si = # of input symbols and So = # of output symbols. Constant time and space to visit an input state or arc is assumed and exclusive of caching.
  -- CyrilAllauzen - 03 Mar 2009

Revision 12009-03-03 - CyrilAllauzen

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="FstQuickTour"

Relabel

Description

Work in progress, under construction TBA

Usage

template <class Arc>
void Relabel(
    MutableFst<Arc> *fst,
    const vector<pair<typename Arc::Label, typename A::Label> >& ipairs,
    const vector<pair<typename Arc::Label, typename A::Label> >& opairs);
%DOX{namespacefst.html#Relabel[doc]}%
template<class Arc>
void Relabel(
     MutableFst<Arc> *fst,
     const SymbolTable* new_isymbols,
     const SymbolTable* new_osymbols);
template <class Arc> RelabelFst<Arc>::
RelabelFst(const Fst<A>& fst,
             const vector<pair<Label, Label> >& ipairs,
             const vector<pair<Label, Label> >& opairs);
%DOX{fst::RelabelFst[doc]}%
template <class Arc> RelabelFst<Arc>::
RelabelFst(const Fst<A>& fst,
             const SymbolTable* new_isymbols,
             const SymbolTable* new_osymbols)
fstrelabel [--relabel_ipairs=$ipairs] [--relabel_opairs=$opairs] in.fst out.fst 
fstrelabel [--relabel_isymbols=$isyms] [--relabel_osymbols=$osyms] in.fst out.fst 

Examples

Work in progress, under construction TBA

Complexity

Relabel

  • Time: O(V + E)
  • Space: O(1)
where V = # of states and E = # of arcs of the input FST.

RelabelFst

  • Time: O(v + e)
  • Space: O(v + e)
where v = # of states visited and e = # of arcs visited of the input FST. Constant time and space to visit an input state or arc is assumed and exclusive of caching.

-- CyrilAllauzen - 03 Mar 2009

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback