@@ -26,7 +26,7 @@ namespace k2 {
26
26
so the output will be topologically sorted if the input
27
27
was.
28
28
*/
29
- void ConnectCore (const Fsa& fsa, std::vector<int32>* state_map);
29
+ void ConnectCore (const Fsa & fsa, std::vector<int32_t > * state_map);
30
30
31
31
/*
32
32
Removes states that are not accessible (from the start state) or are not
@@ -44,13 +44,13 @@ void ConnectCore(const Fsa& fsa, std::vector<int32>* state_map);
44
44
45
45
Notes:
46
46
- If `a` admitted a topological sorting, b will be topologically
47
- sorted. TODO: maybe just leave in the same order as a??
47
+ sorted. TODO(Dan) : maybe just leave in the same order as a??
48
48
- If `a` was deterministic, `b` will be deterministic; same for
49
49
epsilon free, obviously.
50
50
- `b` will be arc-sorted (arcs sorted by label)
51
51
- `b` will (obviously) be connected
52
52
*/
53
- void Connect (const Fsa& a, Fsa* b, std::vector<int32>* arc_map = nullptr );
53
+ void Connect (const Fsa & a, Fsa * b, std::vector<int32_t > * arc_map = nullptr );
54
54
55
55
/* *
56
56
Output an Fsa that is equivalent to the input but which has no epsilons.
@@ -61,10 +61,10 @@ void Connect(const Fsa& a, Fsa* b, std::vector<int32>* arc_map = nullptr);
61
61
@param [out] arc_map If non-NULL: for each arc in `b`, a list of
62
62
the arc-indexes in `a` that contributed to that arc
63
63
(e.g. its cost would be a sum of their costs).
64
- TODO: make it a VecOfVec, maybe?
64
+ TODO(Dan) : make it a VecOfVec, maybe?
65
65
*/
66
- void RmEpsilons (const Fsa& a, Fsa* b,
67
- std::vector<std::vector>* arc_map = nullptr );
66
+ void RmEpsilons (const Fsa & a, Fsa * b,
67
+ std::vector<std::vector> * arc_map = nullptr );
68
68
69
69
/* *
70
70
Pruned version of RmEpsilons, which also uses a pruning beam.
@@ -77,12 +77,12 @@ void RmEpsilons(const Fsa& a, Fsa* b,
77
77
@param [out] arc_map If non-NULL: for each arc in `b`, a list of
78
78
the arc-indexes in `a` that contributed to that arc
79
79
(e.g. its cost would be a sum of their costs).
80
- TODO: make it a VecOfVec, maybe?
80
+ TODO(Dan) : make it a VecOfVec, maybe?
81
81
*/
82
- void RmEpsilonsPruned (const Fsa& a, const float * a_state_forward_costs,
83
- const float * a_state_backward_costs,
84
- const float * a_arc_costs, float cutoff, Fsa* b,
85
- std::vector<std::vector>* arc_map = nullptr );
82
+ void RmEpsilonsPruned (const Fsa & a, const float * a_state_forward_costs,
83
+ const float * a_state_backward_costs,
84
+ const float * a_arc_costs, float cutoff, Fsa * b,
85
+ std::vector<std::vector> * arc_map = nullptr );
86
86
87
87
/*
88
88
Compute the intersection of two FSAs; this is the equivalent of composition
@@ -104,16 +104,16 @@ void RmEpsilonsPruned(const Fsa& a, const float* a_state_forward_costs,
104
104
size c->arcs.size(), saying for each arc in
105
105
`c` what the source arc in `b` was.
106
106
*/
107
- void Intersect (const Fsa& a, const Fsa& b, Fsa* c,
108
- std::vector<int32>* arc_map_a = nullptr ,
109
- std::vector<int32>* arc_map_b = nullptr );
107
+ void Intersect (const Fsa & a, const Fsa & b, Fsa * c,
108
+ std::vector<int32_t > * arc_map_a = nullptr ,
109
+ std::vector<int32_t > * arc_map_b = nullptr );
110
110
111
111
/*
112
112
Version of Intersect where `a` is dense?
113
113
*/
114
- void Intersect (const DenseFsa& a, const Fsa& b, Fsa* c,
115
- std::vector<int32>* arc_map_a = nullptr ,
116
- std::vector<int32>* arc_map_b = nullptr );
114
+ void Intersect (const DenseFsa & a, const Fsa & b, Fsa * c,
115
+ std::vector<int32_t > * arc_map_a = nullptr ,
116
+ std::vector<int32_t > * arc_map_b = nullptr );
117
117
118
118
/*
119
119
Version of Intersect where `a` is dense, pruned with pruning beam `beam`.
@@ -124,9 +124,9 @@ void Intersect(const DenseFsa& a, const Fsa& b, Fsa* c,
124
124
125
125
This is the same as time-synchronous Viterbi beam pruning.
126
126
*/
127
- void IntersectPruned (const DenseFsa& a, const Fsa& b, float beam, Fsa* c,
128
- std::vector<int32>* arc_map_a = nullptr ,
129
- std::vector<int32>* arc_map_b = nullptr );
127
+ void IntersectPruned (const DenseFsa & a, const Fsa & b, float beam, Fsa * c,
128
+ std::vector<int32_t > * arc_map_a = nullptr ,
129
+ std::vector<int32_t > * arc_map_b = nullptr );
130
130
131
131
/* *
132
132
Intersection of two weighted FSA's: the same as Intersect(), but it prunes
@@ -152,13 +152,13 @@ void IntersectPruned(const DenseFsa& a, const Fsa& b, float beam, Fsa* c,
152
152
@param [out] state_map_b Maps from arc-index in c to the corresponding
153
153
arc-index in b
154
154
*/
155
- void IntersectPruned2 (const Fsa& a, const float * a_cost, const Fsa& b,
156
- const float * b_cost, float cutoff, Fsa* c,
157
- std::vector<int32>* state_map_a,
158
- std::vector<int32>* state_map_b);
155
+ void IntersectPruned2 (const Fsa & a, const float * a_cost, const Fsa & b,
156
+ const float * b_cost, float cutoff, Fsa * c,
157
+ std::vector<int32_t > * state_map_a,
158
+ std::vector<int32_t > * state_map_b);
159
159
160
- void RandomPath (const Fsa& a, const float * a_cost, Fsa* b,
161
- std::vector<int32>* state_map = nullptr );
160
+ void RandomPath (const Fsa & a, const float * a_cost, Fsa * b,
161
+ std::vector<int32_t > * state_map = nullptr );
162
162
163
163
} // namespace k2
164
164
0 commit comments