TWiki
>
FST Web
>
FstQuickTour
>
ArcMapDoc
(2018-04-27,
MichaelRiley
)
(raw view)
E
dit
A
ttach
---+ !ArcMap ---++ Description This operation transforms each arc and final state in the input FST. The transformation is specified by a function object called an _arc mapper_. For instance, =RmWeightMapper= %DOX{structfst_1_1_rm_weight_mapper.html[%H%]}% replaces the weight of every arc and final state by <span style="text-decoration:overline">1</span></code>. A list of available arc mappers and instructions on how to create them are given [[FstAdvancedUsage#ArcMappers][here]]. ---++ Usage | <verbatim>template <class Arc, class ArcMapper> ArcMap(MutableFst<Arc> *fst, ArcMapper *mapper); </verbatim> | | | <verbatim>template <class Arc, class ArcMapper> ArcMap(MutableFst<Arc> *fst, ArcMapper mapper); </verbatim> |^| | <verbatim>template <class Arc, class ArcMapper> ArcMap(const Fst<Arc> &ifst, MutableFst<Arc> *ofst, ArcMapper *mapper); </verbatim> |^| | <verbatim>template <class Arc, class ArcMapper> ArcMap(const Fst<Arc> &ifst, MutableFst<Arc> *ofst, ArcMapper mapper); </verbatim> |^| | <verbatim>template <class Arc, class ArcMapper> ArcMapFst<Arc>:: ArcMapFst(const Fst<A> &fst, ArcMapper *mapper); </verbatim> | %DOX{fst::ArcMapFst[%H%]}% | | <verbatim>template <class Arc, class ArcMapper> ArcMapFst<Arc>:: ArcMapFst(const Fst<A> &fst, const ArcMapper &mapper); </verbatim> |^| | <verbatim>fstmap [--opts] in.fst out.fst -delta (Comparison/quantization delta) type: double default: 0.0009765625 -map_type (Map operation, one of: "identity", "invert", "plus (--weight)", "quantize (--delta)", "rmweight", "superfinal", "times (--weight)", "to_log", "to_log64", "to_standard" ) type: string default: "identity" -weight (Weight parameter) type: string default: "" </verbatim> || Note =fstmap= also includes [[StateMapDoc][state mappers]]. ---++ Example ---+++ =A=: %ATTACHURL%/map1.png ---+++ =ArcMap(&A, <nop>RmWeightMapper())=: %ATTACHURL%/map2.png <verbatim> ArcMap(&A, RmWeightMapper<StdArc>()); ArcMap(A, &B, RmWeightMapper<StdArc>()); ArcMapFst B(A, RmWeightMapper<StdArc>()); fstmap --map_type=rmweight a.fst b.fst </verbatim> ---++ Complexity =ArcMap:= * Time: _O(c*(V + E))_ * Space: _O(m)_ where _V_ = # of states, _E_ = # of arcs in input FST, _c_ = cost of processing one arc by the mapper and _m_ = total memory usage for the mapper. =ArcMapFst:= * Time: _O(c*(v + e))_ * Space: _O(m)_ where _v_ = # of visited states, _e_ = # of visited arcs in input FST, _c_ = cost of processing one arc by the mapper and _m_ = total memory usage for the mapper. Constant time and space to visit an input state or arc is assumed and exclusive of [[FstAdvancedUsage#FstCaching][caching]]. For instance in the case of =RmWeightMapper=, we have _c = O(1)_ and _m = O(1)_. ---++ See Also [[FstAdvancedUsage#ArcMappers][Arc Mappers]], [[StateMapDoc][StateMap]]
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
map1.png
r1
manage
19.1 K
2009-03-17 - 19:13
CyrilAllauzen
Map example: input FST
png
map2.png
r1
manage
18.2 K
2009-03-17 - 19:13
CyrilAllauzen
Map example: output FST
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r11
<
r10
<
r9
<
r8
<
r7
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r11 - 2018-04-27
-
MichaelRiley
FST
Log In
or
Register
FST Web
Create New Topic
Index
Search
Changes
Notifications
Statistics
Preferences
Webs
Contrib
FST
Forum
GRM
Kernel
Main
Sandbox
TWiki
Main
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback