@@ -47,12 +47,14 @@ int main(int argc, char *argv[]) {
47
47
48
48
bool write_compact = true ;
49
49
int32 num_states_cache = 50000 ;
50
- int32 phi_label = fst::kNoLabel ; // == -1
51
- po.Register (" write-compact" , &write_compact, " If true, write in normal (compact) form." );
52
- po.Register (" phi-label" , &phi_label, " If >0, the label on backoff arcs of the LM" );
50
+ int32 phi_label = fst::kNoLabel ; // == -1
51
+ po.Register (" write-compact" , &write_compact,
52
+ " If true, write in normal (compact) form." );
53
+ po.Register (" phi-label" , &phi_label,
54
+ " If >0, the label on backoff arcs of the LM" );
53
55
po.Register (" num-states-cache" , &num_states_cache,
54
- " Number of states we cache when mapping LM FST to lattice type. "
55
- " More -> more memory but faster." );
56
+ " Number of states we cache when mapping LM FST to lattice type."
57
+ " More -> more memory but faster." );
56
58
po.Read (argc, argv);
57
59
58
60
if (po.NumArgs () != 3 ) {
@@ -72,10 +74,11 @@ int main(int argc, char *argv[]) {
72
74
CompactLatticeWriter compact_lattice_writer;
73
75
LatticeWriter lattice_writer;
74
76
75
- if (write_compact)
77
+ if (write_compact) {
76
78
compact_lattice_writer.Open (lats_wspecifier);
77
- else
79
+ } else {
78
80
lattice_writer.Open (lats_wspecifier);
81
+ }
79
82
80
83
if (ClassifyRspecifier (arg2, NULL , NULL ) == kNoRspecifier ) {
81
84
std::string fst_rxfilename = arg2;
@@ -105,8 +108,11 @@ int main(int argc, char *argv[]) {
105
108
Lattice lat1 = lattice_reader1.Value ();
106
109
ArcSort (&lat1, fst::OLabelCompare<LatticeArc>());
107
110
Lattice composed_lat;
108
- if (phi_label > 0 ) PhiCompose (lat1, mapped_fst2, phi_label, &composed_lat);
109
- else Compose (lat1, mapped_fst2, &composed_lat);
111
+ if (phi_label > 0 ) {
112
+ PhiCompose (lat1, mapped_fst2, phi_label, &composed_lat);
113
+ } else {
114
+ Compose (lat1, mapped_fst2, &composed_lat);
115
+ }
110
116
if (composed_lat.Start () == fst::kNoStateId ) {
111
117
KALDI_WARN << " Empty lattice for utterance " << key << " (incompatible LM?)" ;
112
118
n_fail++;
@@ -123,7 +129,7 @@ int main(int argc, char *argv[]) {
123
129
}
124
130
delete fst2;
125
131
} else {
126
- // composing with each utterance with different fst,
132
+ // Compose each utterance with its matching (by key) FST.
127
133
std::string fst_rspecifier2 = arg2;
128
134
RandomAccessTableReader<fst::VectorFstHolder> fst_reader2 (fst_rspecifier2);
129
135
@@ -135,7 +141,7 @@ int main(int argc, char *argv[]) {
135
141
136
142
if (!fst_reader2.HasKey (key)) {
137
143
KALDI_WARN << " Not producing output for utterance " << key
138
- << " because not present in second table." ;
144
+ << " because it's not present in second table." ;
139
145
n_fail++;
140
146
continue ;
141
147
}
0 commit comments